Skip to content

Commit

Permalink
Remove duplication, simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jan 31, 2024
1 parent 9961013 commit 3e468d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: bcgov-nr/action-test-and-analyse-java@v1.0.0
with:
commands: |
mvn -B verify -Pall-tests checkstyle:checkstyle -Dcheckstyle.skip=false
mvn -B verify -P all-tests checkstyle:checkstyle -Dcheckstyle.skip=false
dir: .
java-cache: maven
java-distribution: temurin
Expand Down
44 changes: 8 additions & 36 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
pull_request:

env:
REGISTRY: ghcr.io
NAME: ${{ github.event.repository.name }}
DOMAIN: apps.silver.devops.gov.bc.ca

concurrency:
Expand Down Expand Up @@ -67,8 +65,6 @@ jobs:

pr-greeting:
name: PR Greeting
env:
PREFIX: ${{ github.event.repository.name }}-${{ github.event.number }}
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand All @@ -82,12 +78,12 @@ jobs:
Thanks for the PR!
Any successful deployments (not always required) will be available below.
[API](https://${{ env.NAME }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}/) available
[API](https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}/) available
Once merged, code will be promoted and handed off to following workflow run.
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml)
build-backend:
build:
name: Backend Image Build
env:
COMPONENT: backend
Expand All @@ -110,26 +106,9 @@ jobs:
tag_fallback: test
token: ${{ secrets.GITHUB_TOKEN }}

tests-backend:
name: Backend Unit Tests
runs-on: ubuntu-22.04
permissions:
checks: write
pull-requests: write
needs: [build-backend]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "maven"

- run: ./mvnw verify -P all-tests checkstyle:checkstyle -Dcheckstyle.skip=false

deploy-dev:
deploy:
name: DEV Deployment
needs: [build-backend, tests-backend]
needs: [build]
runs-on: ubuntu-22.04
timeout-minutes: 15
environment:
Expand All @@ -156,12 +135,7 @@ jobs:

postman:
name: Smoke Test
env:
COMPONENT: backend
ZONE: ${{ github.event.number }}
DOMAIN: apps.silver.devops.gov.bc.ca
needs:
- deploy-dev
needs: [deploy]
environment:
name: dev
runs-on: ubuntu-latest
Expand All @@ -171,22 +145,20 @@ jobs:
checks: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/checkout@v4
- name: API Health check
uses: matt-ball/newman-action@master
with:
collection: postman/FCA.postman_collection.json
envVar: '[{"key":"URL_FCA","value":"https://${{ env.NAME }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}"}]'
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}"}]'
reporters: '["cli"]'
folder: '["general"]'

- name: Postman Smoke Test
uses: matt-ball/newman-action@master
with:
collection: postman/FCA.postman_collection.json
envVar: '[{"key":"URL_FCA","value":"https://${{ env.NAME }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}"}]'
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}"}]'
iterationData: postman/FCA_postman_tests_dev.json
reporters: '["cli", "junit"]'
reporter: '{ "junit" : { "export" : "./postman/report.xml" } }'
Expand Down

0 comments on commit 3e468d0

Please sign in to comment.