save screenshots on failure #2
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: Webdriver Test | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build Docker images | |
run: docker-compose build | |
- name: Run Docker containers | |
run: | | |
docker-compose up -d | |
docker-compose run --rm wdio | |
- name: Check exit code | |
if: always() | |
run: | | |
exit_code=$(docker-compose ps -q wdio --exit-code) | |
echo "Exit code: $exit_code" | |
if [ $exit_code -ne 0 ]; then | |
echo "Test container failed with exit code $exit_code" | |
exit 1 | |
fi | |
- name: Archive screenshots | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: visual-regression-screenshots | |
path: ./src/test/javascript/screenshots |