mirror of
https://github.com/sartography/spiffworkflow-frontend.git
synced 2025-02-25 12:45:22 +00:00
59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Development Code
|
|
uses: actions/checkout@v3
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18.x
|
|
- run: npm install
|
|
- run: npm test
|
|
- run: npm run build --if-present
|
|
# 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
|
|
echo "$PR_NUMBER" > ./pr/pr_number
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: pr_number
|
|
path: pr/
|
|
|
|
cypress-run:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
path: spiffworkflow-frontend
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: sartography/spiffworkflow-backend
|
|
path: spiffworkflow-backend
|
|
- 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
|
|
working-directory: ./spiffworkflow-frontend
|