From 3ab05fc35c7cc0d96f6ba49bda4e0f162635d437 Mon Sep 17 00:00:00 2001 From: lwan Date: Fri, 13 May 2022 15:36:24 -0700 Subject: [PATCH 1/2] [DEVOPS-3384] Add github actions workflow for test --- .circleci/config.yml | 26 -------------------------- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ .travis.yml | 13 ------------- 3 files changed, 35 insertions(+), 39 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0f63952..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Golang CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-go/ for more details -version: 2 -jobs: - build: - docker: - # specify the version - - image: circleci/golang:1.9 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - #### TEMPLATE_NOTE: go expects specific checkout path representing url - #### expecting it in the form of - #### /go/src/github.com/circleci/go-tool - #### /go/src/bitbucket.org/circleci/go-tool - working_directory: /go/src/github.com/moltin/jsonapi - steps: - - checkout - - # specify any bash command here prefixed with `run: ` - - run: go get -v -t -d ./... - - run: go test -v ./... diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..cb9eb0f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: CI/CD for the jsonapi + +on: + push: + pull_request: + branches: + - 'main' + +jobs: + # This job uses skip-duplicate-actions to skip one of the duplicate workflow runs when you push to a branch with an open PR. + check_duplicate_workflow: + needs: [] + runs-on: ubuntu-20.04 + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v3.4.1 + with: + skip_after_successful_duplicate: 'true' + concurrent_skipping: 'same_content_newer' + do_not_skip: '["push"]' + + test: + needs: [check_duplicate_workflow] + runs-on: ubuntu-20.04 + container: 'golang: 1.16.15' + if: ${{ needs.check_duplicate_workflow.outputs.should_skip != 'true' }} + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Run tests + run: | + go get -v -t -d ./... + go test -v ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6e73a06..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -arch: - - amd64 - - ppc64le -go: - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x - - 1.14.x - - 1.15.x - - tip -script: go test ./... -v From c4148624f2a7115fa7742aca65ee1f43dce8a8a7 Mon Sep 17 00:00:00 2001 From: lwan Date: Fri, 13 May 2022 15:41:56 -0700 Subject: [PATCH 2/2] Fixed image --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb9eb0f..a84e90e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: test: needs: [check_duplicate_workflow] runs-on: ubuntu-20.04 - container: 'golang: 1.16.15' + container: golang:1.16.15 if: ${{ needs.check_duplicate_workflow.outputs.should_skip != 'true' }} steps: - name: Check out repository code