diff --git a/.github/workflows/api-check.yml b/.github/workflows/api-check.yml new file mode 100644 index 00000000..a5fe9664 --- /dev/null +++ b/.github/workflows/api-check.yml @@ -0,0 +1,31 @@ +name: API Validation Check + +on: + schedule: + - cron: '0 6 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + verify-api: + name: Verify API Health + runs-on: ubuntu-22.04 + strategy: + matrix: + package: [ test, prod ] + env: + OS_DOMAIN: apps.silver.devops.gov.bc.ca + steps: + - uses: actions/checkout@v3 + + - name: Check Health on ${{ matrix.package }} environment + uses: matt-ball/newman-action@master + with: + collection: postman/OG.postman_collection.json + envVar: '[{"key":"URL_OG","value":"https://${{ github.event.repository.name }}-${{ matrix.package }}-backend.${{ env.OS_DOMAIN }}"}]' + reporters: '["cli"]' + folder: '["general"]' + \ No newline at end of file diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index ecbd7b59..076fd9c2 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -91,9 +91,9 @@ jobs: builds: name: Image Build - runs-on: ubuntu-22.04 - permissions: - packages: write + runs-on: ubuntu-22.04 + permissions: + packages: write steps: - name: Checkout repository uses: actions/checkout@v3 @@ -111,7 +111,7 @@ jobs: deploy-database: name: Deploy Database - needs: + needs: - builds environment: dev runs-on: ubuntu-22.04 @@ -127,16 +127,16 @@ jobs: overwrite: false parameters: -p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }} - + deploy-backend: name: Deploy Backend - needs: + needs: - deploy-database environment: dev runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - + - name: Deploys uses: bcgov-nr/action-deployer-openshift@v1.0.3 with: @@ -144,7 +144,7 @@ jobs: oc_namespace: ${{ secrets.OC_NAMESPACE }} oc_server: ${{ secrets.OC_SERVER }} oc_token: ${{ secrets.OC_TOKEN }} - overwrite: true + overwrite: true parameters: -p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }} -p PROMOTE=${{ github.repository }}/backend:${{ github.event.number }} @@ -155,5 +155,3 @@ jobs: -p NODE_ENV='development' -p BCEID_FORM_PASSWORD=${{ secrets.CHEFS_BCEID_FORM_PASSWORD}} -p IDIR_FORM_PASSWORD=${{ secrets.CHEFS_IDIR_FORM_PASSWORD}} - - \ No newline at end of file diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index adf2a0f6..b5f899bf 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -47,7 +47,7 @@ jobs: delete-old-comments: true github-token: ${{ secrets.GHCR_TOKEN }} lcov-file: ./backend/coverage/lcov.info - + trivy: name: Repository Report if: github.event_name != 'pull_request' || !github.event.pull_request.draft diff --git a/postman/OG.postman_collection.json b/postman/OG.postman_collection.json new file mode 100644 index 00000000..fe6de066 --- /dev/null +++ b/postman/OG.postman_collection.json @@ -0,0 +1,44 @@ +{ + "info": { + "_postman_id": "8a93e7e0-b8e2-4eaf-a5e0-d41bf1b1aa6e", + "name": "nr-old-growth", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "17369587" + }, + "item": [ + { + "name": "Health", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Body matches OK\", function () {\r", + " pm.expect(pm.response.text()).to.include(\"Ok\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{URL_OG}}/check", + "host": [ + "{{URL_OG}}" + ], + "path": [ + "check" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file