Skip to content

Tests

Tests #78

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
paths-ignore:
- 'LICENSE.*'
- 'README.*'
- '.github/ISSUE-TEMPLATE/**'
- 'docs/**'
- '.hgignore'
- '.gitignore'
pull_request:
branches: [ main ]
paths-ignore:
- 'LICENSE.*'
- 'README.*'
- '.github/ISSUE-TEMPLATE/**'
- 'docs/**'
- '.hgignore'
- '.gitignore'
schedule: # at 03:06 on day-of-month 6
- cron: '6 3 6 * *'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9']
exclude:
# macos-latest does not have Python 3.7
- os: macos-latest
python-version: '3.7'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Add Homebrew to PATH (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
- name: Set up age and minisign (POSIX)
if: ${{ matrix.os != 'windows-latest' }}
run: |
brew install age minisign
- name: Set up age and minisign (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install age.portable
choco install minisign
- name: Test with unittest
run: |
age --version
minisign -v
python test_pagesign.py
- name: Test with coverage
run: |
pip install coverage
coverage run --branch test_pagesign.py
coverage xml
- name: Upload coverage to Codecov
# Repeated failures of Codecov on macos-12
if: ${{ matrix.os != 'macos-12' }}
uses: codecov/codecov-action@v3
with:
flags: unittests
files: coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}