-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from ThomasWaldmann/gha
add a github actions CI workflow, fixes #255
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# badge: https://github.com/bepasty/bepasty-server/workflows/CI/badge.svg?branch=master | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- '**.py' | ||
- '**.yml' | ||
- '**.cfg' | ||
- '**.ini' | ||
- 'requirements.d/*' | ||
- '!docs/**' | ||
pull_request: | ||
branches: [ master ] | ||
paths: | ||
- '**.py' | ||
- '**.yml' | ||
- '**.cfg' | ||
- '**.ini' | ||
- 'requirements.d/*' | ||
- '!docs/**' | ||
|
||
jobs: | ||
lint: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
flake8 src scripts conftest.py | ||
pytest: | ||
|
||
needs: lint | ||
env: | ||
# Configure pkg-config to use OpenSSL from Homebrew | ||
PKG_CONFIG_PATH: /usr/local/opt/[email protected]/lib/pkgconfig | ||
TOXENV: ${{ matrix.toxenv }} | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.5 | ||
- name: Install Python requirements | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install -r requirements.d/development.txt | ||
- name: run pytest via tox | ||
run: | | ||
tox --skip-missing-interpreters | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
env: | ||
OS: ${{ runner.os }} | ||
python: ${{ matrix.python-version }} | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
env_vars: OS, python |