2022-06-09 15:44:58 -04:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
2022-06-10 08:58:51 -04:00
|
|
|
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
|
|
|
|
|
2022-06-09 15:44:58 -04:00
|
|
|
jobs:
|
2022-06-09 15:54:19 -04:00
|
|
|
tests:
|
2022-06-09 15:44:58 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Development Code
|
2022-06-09 19:54:57 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-06-09 15:54:19 -04:00
|
|
|
- name: Setup Node
|
2022-06-09 19:54:59 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-06-09 15:44:58 -04:00
|
|
|
with:
|
2022-06-09 15:54:19 -04:00
|
|
|
node-version: 18.x
|
2022-06-09 15:44:58 -04:00
|
|
|
- run: npm install
|
|
|
|
- run: npm test
|
|
|
|
- run: npm run build --if-present
|
2022-06-09 19:21:33 -04:00
|
|
|
# part about saving PR number and then using it from auto-merge-dependabot-prs from:
|
|
|
|
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
|
|
|
|
- name: Save PR number
|
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
|
|
run: |
|
|
|
|
mkdir -p ./pr
|
2022-06-10 08:58:51 -04:00
|
|
|
echo "$PR_NUMBER" > ./pr/pr_number
|
2022-06-09 19:21:33 -04:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: pr_number
|
|
|
|
path: pr/
|
2022-06-17 10:07:05 -04:00
|
|
|
|
|
|
|
cypress-run:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-06-17 10:12:18 -04:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: spiffworkflow-frontend
|
2022-06-17 10:07:05 -04:00
|
|
|
- name: Checkout
|
2022-06-17 10:12:18 -04:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: sartography/spiffworkflow-backend
|
|
|
|
path: spiffworkflow-backend
|
2022-06-17 10:07:05 -04:00
|
|
|
- name: start_backend
|
|
|
|
working-directory: ./spiffworkflow-backend
|
|
|
|
run: ./bin/build_and_run_with_docker_compose
|
|
|
|
- name: start_frontend
|
|
|
|
working-directory: ./spiffworkflow-frontend
|
|
|
|
run: ./bin/build_and_run_with_docker_compose
|
|
|
|
# Install NPM dependencies, cache them correctly
|
|
|
|
# and run all Cypress tests
|
|
|
|
- name: Cypress run
|
|
|
|
uses: cypress-io/github-action@v4
|
2022-06-17 10:13:35 -04:00
|
|
|
with:
|
|
|
|
working-directory: ./spiffworkflow-frontend
|