Add our fork of wagtaildraftsharing to Bedrock #5109
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: Unit tests | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
jobs: | |
test-js: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Install framebuffer (xvfb) and Chromium" | |
run: | | |
sudo apt-get update | |
sudo apt-get install chromium-browser xvfb | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: "Install JS dependencies" | |
run: npm ci | |
- name: "Run JS tests" | |
run: xvfb-run npm test | |
test-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" # matches current Python in production | |
- name: "Run Python tests (on Docker)" | |
run: | | |
make clean test-image | |
CONTAINER_ID=$(docker ps -alq) | |
docker cp $CONTAINER_ID:/app/python_coverage . | |
- name: Store coverage as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-results | |
path: python_coverage | |
- name: "Upload coverage to Codecov" | |
uses: codecov/codecov-action@v4 | |
with: | |
# A CodeCov token is normally NOT needed for public repos, but this workaround is suggested here: | |
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954/18 | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: python_coverage/coverage.xml | |
fail_ci_if_error: false # optional (default = false) | |
verbose: true # optional (default = false) |