Cypress Tests #1135
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: Cypress Tests | |
on: [deployment_status] | |
jobs: | |
Setup: | |
if: github.event.deployment_status.state == 'success' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pipx install pipenv | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
# Can't use cache because of https://github.com/actions/cache/issues/319 | |
# cache: 'pipenv' | |
- name: Install bootstrapper dependencies | |
run: pipenv install --dev --deploy | |
- run: | | |
config_file=$(./scripts/vue_or_react.sh) | |
pipenv run cookiecutter . --config-file $config_file --no-input -f | |
cat $config_file | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: my_project | |
path: my_project/ | |
retention-days: 1 | |
Chrome: | |
needs: Setup | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node16.14.2-slim-chrome103-ff102 # https://github.com/cypress-io/cypress-docker-images/tree/master/browsers | |
options: --user 1001 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: my_project | |
path: my_project/ | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Install frontend dependencies | |
env: | |
NPM_CONFIG_PRODUCTION: false | |
working-directory: ./my_project/client | |
run: npm install | |
- name: Run against ${{ github.event.deployment_status.environment_url }} | |
uses: cypress-io/github-action@v6 | |
with: | |
working-directory: my_project/client | |
browser: chrome | |
env: | |
NPM_CONFIG_PRODUCTION: false | |
CYPRESS_TEST_USER_EMAIL: "[email protected]" | |
CYPRESS_TEST_USER_PASS: ${{ secrets.CYPRESS_TEST_USER_PASS }} | |
CYPRESS_baseUrl: ${{ github.event.deployment_status.environment_url }} | |
Firefox: | |
needs: Setup | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node16.14.2-slim-chrome103-ff102 # https://github.com/cypress-io/cypress-docker-images/tree/master/browsers | |
options: --user 1001 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: my_project | |
path: my_project/ | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Install frontend dependencies | |
env: | |
NPM_CONFIG_PRODUCTION: false | |
working-directory: ./my_project/client | |
run: npm install | |
- name: Run against ${{ github.event.deployment_status.environment_url }} | |
uses: cypress-io/github-action@v6 | |
with: | |
working-directory: my_project/client | |
browser: firefox | |
env: | |
NPM_CONFIG_PRODUCTION: false | |
CYPRESS_TEST_USER_EMAIL: "[email protected]" | |
CYPRESS_TEST_USER_PASS: ${{ secrets.CYPRESS_TEST_USER_PASS }} | |
CYPRESS_baseUrl: ${{ github.event.deployment_status.environment_url }} |