From db89847e19f5ce66b348bf5d3b46aaeb851d46fd Mon Sep 17 00:00:00 2001 From: Swathi Velivala Date: Tue, 3 Dec 2024 15:36:46 +0530 Subject: [PATCH 1/9] TECHOPS-2394 Migrate circleci to github actions --- .github/workflows/pr-validation.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pr-validation.yml diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml new file mode 100644 index 0000000..9d4d8c1 --- /dev/null +++ b/.github/workflows/pr-validation.yml @@ -0,0 +1,35 @@ +name: Build and Deploy + +on: + pull_request: + types: [opened, reopened, edited, synchronize] + workflow_dispatch: + inputs: + branch: + description: 'Branch to deploy' + required: true + default: 'dev' + environment: + description: environment to deploy + required: true + type: choice + options: + - dev + - prod +jobs: + + test: + #needs: build + #Build job is to be executed only for pull_request events + if: ${{ github.event_name == 'pull_request' }} + uses: everwise/github-workflows/.github/workflows/test-conflisp.yml@TECHOPS-1811 + + deploy: + #Deploy job is to be executed only for workflow_dispatch events and when a pull request is merged into the dev branch + #needs: build + if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && (github.ref_name == 'dev')) }} + uses: everwise/github-workflows/.github/workflows/deploy-conflisp.yml@TECHOPS-1811 + with: + branch: ${{ github.ref_name }} + environment: ${{ github.ref_name == 'master' && 'prod' || 'dev' }} + secrets: inherit \ No newline at end of file From 22d1885049a372d4d71aaa56f4a740337cc73e17 Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Tue, 3 Dec 2024 18:11:05 +0530 Subject: [PATCH 2/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 9d4d8c1..9a516cf 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -19,11 +19,9 @@ on: jobs: test: - #needs: build - #Build job is to be executed only for pull_request events if: ${{ github.event_name == 'pull_request' }} uses: everwise/github-workflows/.github/workflows/test-conflisp.yml@TECHOPS-1811 - + deploy: #Deploy job is to be executed only for workflow_dispatch events and when a pull request is merged into the dev branch #needs: build @@ -32,4 +30,4 @@ jobs: with: branch: ${{ github.ref_name }} environment: ${{ github.ref_name == 'master' && 'prod' || 'dev' }} - secrets: inherit \ No newline at end of file + secrets: inherit From 38eade273327236a1e6927eb4142da33d4aee4d2 Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Tue, 3 Dec 2024 18:39:05 +0530 Subject: [PATCH 3/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 9a516cf..4117fad 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -20,7 +20,7 @@ jobs: test: if: ${{ github.event_name == 'pull_request' }} - uses: everwise/github-workflows/.github/workflows/test-conflisp.yml@TECHOPS-1811 + uses: everwise/github-workflows/.github/workflows/test-vieques.yml@TECHOPS-1811 deploy: #Deploy job is to be executed only for workflow_dispatch events and when a pull request is merged into the dev branch From ba955ea28e2fa91491da22f5b97cfd327e937193 Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Wed, 4 Dec 2024 14:00:42 +0530 Subject: [PATCH 4/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 76 ++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 4117fad..16298a6 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -17,17 +17,69 @@ on: - dev - prod jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 - test: - if: ${{ github.event_name == 'pull_request' }} - uses: everwise/github-workflows/.github/workflows/test-vieques.yml@TECHOPS-1811 - - deploy: - #Deploy job is to be executed only for workflow_dispatch events and when a pull request is merged into the dev branch - #needs: build - if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && (github.ref_name == 'dev')) }} - uses: everwise/github-workflows/.github/workflows/deploy-conflisp.yml@TECHOPS-1811 + - name: Restore bundle cache + uses: actions/cache@v2 + with: + path: vendor/bundle + key: v1-bundle-${{ github.ref }}-${{ hashFiles('conflisp.gemspec') }} + restore-keys: | + v1-bundle-${{ github.ref }}- + v1-bundle- + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + - name: Install dependencies + run: bundle install + + - name: Save bundle cache + uses: actions/cache@v2 with: - branch: ${{ github.ref_name }} - environment: ${{ github.ref_name == 'master' && 'prod' || 'dev' }} - secrets: inherit + path: vendor/bundle + key: v1-bundle-${{ github.ref }}-${{ hashFiles('conflisp.gemspec') }} + + - name: Run tests + run: | + bundle exec rspec -r rspec_junit_formatter --format RspecJunitFormatter -o tmp/junit.xml + + - name: Run linter + run: bundle exec rubocop + + - name: Store coverage artifacts + uses: actions/upload-artifact@v2 + with: + name: coverage + path: coverage + + - name: Store test results + uses: actions/upload-artifact@v2 + with: + name: test-results + path: tmp + + - name: Send Coverage to Codacy + run: | + bash <(curl -Ls https://coverage.codacy.com/get.sh) report --coverage-reports coverage/lcov/project.lcov + + # test: + # if: ${{ github.event_name == 'pull_request' }} + # uses: everwise/github-workflows/.github/workflows/test-vieques.yml@TECHOPS-1811 + + # deploy: + # #Deploy job is to be executed only for workflow_dispatch events and when a pull request is merged into the dev branch + # #needs: build + # if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && (github.ref_name == 'dev')) }} + # uses: everwise/github-workflows/.github/workflows/deploy-conflisp.yml@TECHOPS-1811 + # with: + # branch: ${{ github.ref_name }} + # environment: ${{ github.ref_name == 'master' && 'prod' || 'dev' }} + # secrets: inherit + From 17d21664d182bda66055193982ef1e6b5478c31f Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Wed, 4 Dec 2024 14:02:52 +0530 Subject: [PATCH 5/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 16298a6..d476623 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -2,7 +2,7 @@ name: Build and Deploy on: pull_request: - types: [opened, reopened, edited, synchronize] + types: [opened, reopened, edited] workflow_dispatch: inputs: branch: @@ -54,13 +54,13 @@ jobs: run: bundle exec rubocop - name: Store coverage artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coverage path: coverage - name: Store test results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: test-results path: tmp From b828f6cb1ad47b7e4d5823cf61245a00485ce08d Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Fri, 6 Dec 2024 14:47:13 +0530 Subject: [PATCH 6/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index d476623..4e1d7dd 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -65,9 +65,9 @@ jobs: name: test-results path: tmp - - name: Send Coverage to Codacy - run: | - bash <(curl -Ls https://coverage.codacy.com/get.sh) report --coverage-reports coverage/lcov/project.lcov + # - name: Send Coverage to Codacy + # run: | + # bash <(curl -Ls https://coverage.codacy.com/get.sh) report --coverage-reports coverage/lcov/project.lcov # test: # if: ${{ github.event_name == 'pull_request' }} From 6460315b467ae482f2cee6e8d969cbb0a734360b Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Fri, 6 Dec 2024 14:58:13 +0530 Subject: [PATCH 7/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 4e1d7dd..ce87b63 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -18,7 +18,7 @@ on: - prod jobs: tests: - runs-on: ubuntu-latest + runs-on: self-runners steps: - name: Checkout code uses: actions/checkout@v2 From e7b138550ff81e34f0f916a0cd583d3a60ae72c8 Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Fri, 6 Dec 2024 15:07:52 +0530 Subject: [PATCH 8/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 37 +++-------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index ce87b63..e6e30b6 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -2,23 +2,11 @@ name: Build and Deploy on: pull_request: - types: [opened, reopened, edited] - workflow_dispatch: - inputs: - branch: - description: 'Branch to deploy' - required: true - default: 'dev' - environment: - description: environment to deploy - required: true - type: choice - options: - - dev - - prod + types: [opened, reopened, edited, synchronize] + jobs: tests: - runs-on: self-runners + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 @@ -64,22 +52,3 @@ jobs: with: name: test-results path: tmp - - # - name: Send Coverage to Codacy - # run: | - # bash <(curl -Ls https://coverage.codacy.com/get.sh) report --coverage-reports coverage/lcov/project.lcov - - # test: - # if: ${{ github.event_name == 'pull_request' }} - # uses: everwise/github-workflows/.github/workflows/test-vieques.yml@TECHOPS-1811 - - # deploy: - # #Deploy job is to be executed only for workflow_dispatch events and when a pull request is merged into the dev branch - # #needs: build - # if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && (github.ref_name == 'dev')) }} - # uses: everwise/github-workflows/.github/workflows/deploy-conflisp.yml@TECHOPS-1811 - # with: - # branch: ${{ github.ref_name }} - # environment: ${{ github.ref_name == 'master' && 'prod' || 'dev' }} - # secrets: inherit - From b40a8fb353a9dab9c693c2d9d465b4e3cc282883 Mon Sep 17 00:00:00 2001 From: swathivelivala Date: Fri, 13 Dec 2024 20:00:03 +0530 Subject: [PATCH 9/9] Update pr-validation.yml --- .github/workflows/pr-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index e6e30b6..60efc17 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -1,4 +1,4 @@ -name: Build and Deploy +name: Tests on: pull_request: