Skip to content

Commit

Permalink
ci: Add GitHub actions pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
g3n35i5 committed Jun 9, 2024
1 parent b8dced7 commit 5302f94
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI pipeline

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.8"]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: python -m pip install --upgrade pip tox tox-gh-actions

- name: Run tests
run: tox

- name: Upload coverage artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python-version }}
path: reports/.coverage.*test

coverage:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Download all coverage artifacts
uses: actions/download-artifact@v3

- name: Copy coverage reports to reports folder
run: mkdir reports && find . -type f -path "./coverage-3.*/*" -exec cp {} reports/ \;

- name: Install tox
run: python -m pip install --upgrade pip tox

- name: Combine coverage results
run: tox run -e combine-test-reports

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install tox
run: python -m pip install --upgrade tox

- name: Run static checks
run: tox -e lint

0 comments on commit 5302f94

Please sign in to comment.