Run Docker tests #25
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
# Workflow for running the test suite including long-running tests using Docker | |
name: Run Docker tests | |
on: | |
schedule: | |
# Run every Friday at 12:00 AM UTC | |
- cron: "0 0 * * 5" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Test suite | |
runs-on: ubuntu-latest | |
env: | |
TAR: /bin/tar | |
DOCKER_BUILDKIT: 1 | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch origin | |
run: | | |
git fetch origin | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.branch }} | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- uses: r-lib/actions/setup-tinytex@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: liskin/gh-pipx@v1 | |
with: | |
packages: >- | |
poetry | |
- uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
create-args: >- | |
python=3.9 | |
init-shell: >- | |
bash | |
cache-environment: true | |
cache-environment-key: requirements-${{ hashFiles('environment.yml') }} | |
- name: Install dependencies | |
run: | | |
micromamba activate otter-grader | |
poetry install --with dev,test --all-extras | |
- name: Install ottr | |
run: | | |
micromamba run -n otter-grader Rscript -e 'install.packages("ottr", dependencies=TRUE, repos="https://cran.r-project.org/")' | |
- name: Maximize build space | |
run: | | |
sudo swapoff -a | |
sudo rm -f /swapfile | |
sudo apt clean | |
df -h | |
- name: Run tests | |
run: | | |
micromamba activate otter-grader | |
make testcov PYTESTOPTS="-vv" && coverage lcov -i | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 |