Run tests on GitHub Action (#3) #15
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
name: Run Docker Tests and Upload Results | |
on: | |
workflow_dispatch: | |
inputs: | |
A11Y_CHECKOUT: | |
description: 'Checkout a specific purple a11y branch' | |
required: false | |
default: 'git+https://github.com/GovTechSG/purple-a11y.git#master' | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v1 | |
- name: Run start_docker.sh script | |
run: | | |
chmod +x ./shell_scripts/start_docker.sh | |
./shell_scripts/start_docker.sh "${{ github.event.inputs.A11Y_CHECKOUT || 'git+https://github.com/GovTechSG/purple-a11y.git#master' }}" | |
- name: Run stop_docker.sh script | |
run: | | |
chmod +x ./shell_scripts/stop_docker.sh | |
./shell_scripts/stop_docker.sh | |
- name: Zip Cypress reports folder | |
run: zip -r cypress-reports.zip ./cypress | |
- name: Upload Cypress reports as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cypress-reports | |
path: cypress-reports.zip |