Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian committed Apr 22, 2024
1 parent 2a8e651 commit e5f5e73
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build and test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build_test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Build
run: python -m build
- name: Install on Unix
if: matrix.os != 'windows-latest'
run: pip install dist/*.whl
- name: Install on Windows
if: matrix.os == 'windows-latest'
run: pip install (Get-ChildItem dist/*.whl)
- name: Test
run: python -m unittest
- name: Generate Coverage Report
run: |
coverage run --source coredumpy --parallel-mode -m unittest
coverage combine
coverage xml -i
env:
COVERAGE_RUN: True
- name: Upload report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
26 changes: 26 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: lint

on:
push:
branches:
- master
pull_request:

jobs:
lint:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependency
run: pip install flake8 mypy
- name: Run flake8
run: flake8 src/ tests/ --count --ignore=W503 --max-line-length=127 --statistics
- name: Run mypy
run: mypy src/

0 comments on commit e5f5e73

Please sign in to comment.