Add action to push screenshots to conda store #368
Workflow file for this run
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: Playwright Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test-conda-store-ui: | |
name: "unit-test conda-store-ui" | |
strategy: | |
matrix: | |
# cannot run on windows due to needing fake-chroot for conda-docker | |
# osx takes forever to get a scheduled job | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: "Checkout repository 🛎" | |
uses: actions/checkout@v4 | |
- name: "Set up Python 🐍" | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
mamba-version: "*" | |
channels: conda-forge | |
activate-environment: cs-ui-dev-env | |
environment-file: environment_dev.yml | |
auto-activate-base: false | |
- name: "Set up environment variables 🔨" | |
run: | | |
cp .env.example .env | |
- name: "Install Dependencies 📦" | |
run: | | |
sudo apt install wait-for-it -y | |
playwright install chromium | |
yarn install --immutable | |
yarn run build | |
- name: "Start web server and run tests 🧪" | |
shell: bash -el {0} | |
run: | | |
yarn run start & | |
wait-for-it localhost:8000 -t 240 # wait for conda-store-ui to start (seconds) | |
- name: "Run playwright tests" | |
shell: bash -el {0} | |
run: | | |
pytest --video on --output video --screenshots true test/playwright/test_ux.py | |
# screenshots are used in the `push_images` workflow to push the screenshots to the codebase repo | |
- name: "Upload screenshot artifacts 📤" | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: screenshots | |
path: test-results | |
# video is added as an artifact to assist in debugging the CI failures, playwright traceback | |
# often shows failures several steps beyond the actual failure which can be seen in a video | |
- name: "Upload video artifact 📤" | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: video | |
path: video |