DESC Example 3 #52
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
# Author - Stuart McAlpine - [email protected] - Jan 2023 | |
name: DESC Example 3 | |
# How does the workflow get triggered? | |
on: | |
# Automatically run every Friday at midnight. | |
schedule: | |
- cron: '0 0 * * 4' | |
# Have option to manually trigger workflow. | |
workflow_dispatch: null | |
# List of jobs for this workflow. | |
jobs: | |
# Our pytest job. | |
ci-with-pytest: | |
# Our strategy lists the OS and Python versions containers to run within. | |
strategy: | |
# Don't quit all jobs if only one job fails. | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-20.04", "ubuntu-22.04"] | |
python-version: ["py38", "py39"] | |
# What operating system is this job running on? | |
runs-on: ubuntu-latest | |
# Specify the lsstdesc container to pull from DockerHub and operate within. | |
container: lsstdesc/desc-python-${{ matrix.os }}-${{ matrix.python-version }}:ci-dev | |
# Our CI steps for this job. | |
steps: | |
# Check out this repository code. | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
# Install dependencies. | |
- name: Install mydescpackage. | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[ci] | |
# Do some basic code linting using flake8. Check for syntax and indentation errors. | |
- name: flake8 linting. | |
run: flake8 --count --select=E1,E9 --show-source --statistics ./src/mydescpackage/*.py | |
# Perform the unit tests and output a report. | |
- name: Test with pytest | |
run: pytest --cov=mydescpackage --cov-report xml ./tests | |
# Upload the code coverage results to codecov.io. | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 |