Executing test QA on UK-Export-Finance/mdm-api π #1528
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MDM-API Git Hub Actions | |
##################################### | |
# This GHA is responsible for initiating various test suites | |
# upon a PR creation. Following test suites are executed: | |
# 1. Unit tests (Jest) | |
# 2. API tests (Jest) | |
name: Quality Assurance - Tests | |
run-name: Executing test QA on ${{ github.repository }} π | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- "**" | |
env: | |
environment: "qa" | |
TIMEZONE: ${{ vars.TIMEZONE }} | |
jobs: | |
# 1. Setup test infrastructure | |
setup: | |
name: Infrastructure setup π§ | |
runs-on: ubuntu-latest | |
outputs: | |
environment: ${{ env.environment }} | |
timezone: ${{ env.timezone }} | |
steps: | |
- name: Environment π§ͺ | |
run: echo "Environment set to ${{ env.environment }}" | |
- name: Timezone π | |
run: echo "Timezone set to ${{ env.timezone }}" | |
# 2. Unit tests | |
unit-tests: | |
name: Unit π· | |
needs: setup | |
environment: | |
name: ${{ needs.setup.outputs.environment }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Timezone | |
uses: szenius/[email protected] | |
with: | |
timezoneLinux: ${{ needs.setup.outputs.timezone }} | |
- name: Repository | |
uses: actions/checkout@v4 | |
- name: Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ vars.NODE_VERSION }} | |
- name: Dependencies | |
working-directory: ./ | |
run: npm ci --legacy-peer-deps | |
- name: Execute | |
working-directory: ./ | |
run: npm run unit-test |