Skip to content

Commit

Permalink
ci: initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward-Jackson-ONS committed Aug 15, 2024
1 parent f6ab11f commit 8fad439
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Continuous integration

on:
pull_request:
push:
branches:
- main
- "dev*"

jobs:
test:
permissions:
contents: read
id-token: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", 3.11, 3.12]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Update pip and install the package
run: |
python -m pip install --upgrade pip
python -m pip install ".[test]"
- name: Run tests
run: |
python -m pytest tests
- name: Install and run linters
if: |
matrix.python-version == 3.11
run: |
python -m pip install ".[dev]"
python -m ruff check .
python -m ruff format --check .
- name: Generate Report
run: |
coverage run -m pytest
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
verbose: true
token: ${{secrets.CODECOV_TOKEN}}

0 comments on commit 8fad439

Please sign in to comment.