Skip to content

Disable some tests

Disable some tests #98

Workflow file for this run

name: Tests
on:
push:
branches-ignore:
- gh-pages
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# These container builds don't pull caches from the Docker registry, so they
# are very slow. Disabling them for now.
# dev-container:
# name: Deploy dev-container
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: docker/build-push-action@v1
# with:
# dockerfile: containers/Dockerfile
# target: dev
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# repository: nilsleiffischer/gwpv
# # This would tag the container 'latest', not taking the build target
# # into account. So we tag the container 'latest-dev' manually, but
# # note that the container will be overridden by pushes to other
# # branches.
# # See: https://github.com/docker/build-push-action/issues/83
# # tag_with_ref: true
# tags: latest-dev
# always_pull: true
# cache_froms: nilsleiffischer/gwpv:latest-dev
tests:
name: Tests
runs-on: ubuntu-latest
# needs: dev-container
container: nilsleiffischer/gwpv:latest-dev
steps:
- uses: actions/checkout@v3
- name: Setup Python package
run: |
pip3 install .
- name: Run unit tests
run: |
python3 -m unittest discover -s tests
# - name: Setup rendering test
# run: |
# mkdir test_rendering
# - name: Test 'scene' endpoint
# working-directory: test_rendering
# run: >
# gwrender scene
# $GITHUB_WORKSPACE/Examples/Rainbow/Rainbow.yaml Resolutions/Test
# -o ./ -n2 -v
# - name: Test 'scenes' endpoint
# working-directory: test_rendering
# run: >
# gwrender scenes
# $GITHUB_WORKSPACE/Examples/Rainbow/Scenes.yaml Resolutions/Test
# -o ./ -n2 -v
# - name: Test 'waveform' endpoint
# working-directory: test_rendering
# run: >
# gwrender waveform $GITHUB_WORKSPACE/Examples/Rainbow/Rainbow.yaml
# --time-merger 5064 --mass 150 -o ./ -v
lint:
name: Formatting and linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Python code format
uses: psf/black@stable
- name: Imports ordering
uses: isort/isort-action@master
- uses: actionsx/prettier@v2
with:
args: --check .
docs:
name: Build documentation
needs: tests
runs-on: ubuntu-latest
container: nilsleiffischer/gwpv:latest-dev
steps:
- uses: actions/checkout@v3
- name: Setup Python package
run: |
pip3 install .
- name: Install Python dependencies
run: |
pip install -r docs/requirements.txt
- name: Build docs
run: |
cd docs
make html
# Not using actions/upload-pages-artifact for now because of issue
# https://github.com/actions/upload-pages-artifact/issues/20
# - uses: actions/upload-pages-artifact@v1
# with:
# path: docs/_build/html
- name: Prepare pages artifact
run: |
tar \
--dereference --hard-dereference \
--directory docs/_build/html \
-cvf docs/_build/html.tar \
--exclude=.git \
--exclude=.github \
.
- uses: actions/upload-artifact@v3
with:
name: github-pages
path: docs/_build/html.tar
retention-days: 1
docs-deploy:
name: Deploy documentation
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
needs: docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v1
id: deploy
deploy-container:
name: Deploy container
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v3
with:
context: .
file: containers/Dockerfile
target: app
tags: nilsleiffischer/gwpv:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
examples:
name: Examples
needs: deploy-container
runs-on: ubuntu-latest
steps:
# Note that the container must run as the user `root` to be able to write
# to the $GITHUB_WORKSPACE directory:
# https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem
- name: Rainbow still
run: >
docker run -v $PWD:/out nilsleiffischer/gwpv:latest
scene Examples/Rainbow/Still.yaml -o /out/Still
- name: Rainbow movie
run: >
docker run -v $PWD:/out nilsleiffischer/gwpv:latest
scene Examples/Rainbow/Rainbow.yaml
--render-movie-to-file /out/Rainbow --num-jobs 2
- name: Rainbow scenes
run: >
docker run -v $PWD:/out nilsleiffischer/gwpv:latest
scenes Examples/Rainbow/Scenes.yaml -o /out/Scenes --num-jobs 2