diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/deploy.yml similarity index 87% rename from .github/workflows/test-and-deploy.yml rename to .github/workflows/deploy.yml index a179ba4b..b955de12 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Unit Tests +name: Deploy on: [push] @@ -8,18 +8,9 @@ env: ECR_REPOSITORY: discovery-api jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set Node version - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - - name: npm install - run: npm ci - - name: Unit Tests - run: npm test + run_tests: + name: Run Tests + uses: ./.github/workflows/tests.yml deploy: permissions: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 75205de5..49dd97e0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -2,7 +2,7 @@ name: Run Smoke Tests on: workflow_run: - workflows: ["Unit tests / deploy"] + workflows: ["Deploy"] types: - completed diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..74d1e6ef --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +name: Unit Tests + +on: [push] + +permissions: + contents: read + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set Node version + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - name: npm install + run: npm ci + - name: Unit Tests + run: npm test \ No newline at end of file