Skip to content

Commit

Permalink
Merge pull request #833 from chrispyles/beta-2
Browse files Browse the repository at this point in the history
Update CI to run Docker tests weekly instead of on every push/PR
  • Loading branch information
chrispyles authored Sep 1, 2024
2 parents 57253ac + e0f4eeb commit 2bba42f
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 8 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/run-docker-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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

strategy:
matrix:
branch: [master, beta]

env:
TAR: /bin/tar
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled

defaults:
run:
shell: bash -l {0}

steps:
- name: Check that branch exists
id: check-branch
run: |
if git show-ref --quiet refs/heads/${{ matrix.branch }}; then
echo "run=true" > $GITHUB_OUTPUT
else
echo "run=false" > $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
if: ${{ steps.check-branch.outputs.run == 'true' }}
with:
ref: ${{ matrix.branch }}

- uses: docker/setup-buildx-action@v2
if: ${{ steps.check-branch.outputs.run == 'true' }}
with:
install: true

- uses: r-lib/actions/setup-tinytex@v2
if: ${{ steps.check-branch.outputs.run == 'true' }}

- uses: r-lib/actions/setup-pandoc@v2
if: ${{ steps.check-branch.outputs.run == 'true' }}

- uses: mamba-org/setup-micromamba@v1
if: ${{ steps.check-branch.outputs.run == 'true' }}
with:
environment-file: environment.yml
init-shell: >-
bash
cache-environment: true
cache-environment-key: requirements-${{ hashFiles('requirements*.txt') }}

- name: Install ottr
if: ${{ steps.check-branch.outputs.run == 'true' }}
run: |
micromamba run -n otter-grader Rscript -e 'install.packages("ottr", dependencies=TRUE, repos="https://cran.r-project.org/")'
- name: Run tests
if: ${{ steps.check-branch.outputs.run == 'true' }}
run: |
micromamba activate otter-grader
make testcov PYTESTOPTS="-vv" && coverage lcov -i
- name: Coveralls
if: ${{ steps.check-branch.outputs.run == 'true' }}
uses: coverallsapp/github-action@v2
10 changes: 2 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,13 @@ jobs:

env:
TAR: /bin/tar
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2

- uses: docker/setup-buildx-action@v2
with:
install: true
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-tinytex@v2

Expand All @@ -56,7 +50,7 @@ jobs:
- name: Run tests
run: |
micromamba activate otter-grader
make testcov PYTESTOPTS="-vv" && coverage lcov -i
make testcov DOCKER=false PYTESTOPTS="-vv" && coverage lcov -i
- name: Coveralls
uses: coverallsapp/github-action@v2

0 comments on commit 2bba42f

Please sign in to comment.