-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55df584
commit 95e8bde
Showing
2 changed files
with
84 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,54 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
test-coverage: | ||
name: pytest & coverage report | ||
runs-on: 'ubuntu-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.6', '3.7'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: goanpeca/setup-miniconda@v1 | ||
with: | ||
auto-update-conda: true | ||
auto-activate-base: false | ||
environment-file: envs/environment-test.yaml | ||
python-version: ${{ matrix.python-version }} | ||
activate-environment: salishsea-site-test | ||
|
||
- name: Install package | ||
shell: bash -l {0} | ||
run: | | ||
python3 -m pip install --editable $GITHUB_WORKSPACE | ||
- name: pytest package with coverage | ||
shell: bash -l {0} | ||
run: | | ||
pytest --cov=$GITHUB_WORKSPACE --cov-report=xml | ||
- uses: pioug/le-slack-message@v1.0.0 | ||
with: | ||
ACTION_NAME: ${{ github.repository }} pytest suite for Python ${{ matrix.python-version }} | ||
JOB: ${{ toJson(job) }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
if: always() | ||
|
||
- name: Upload coverage report to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
flags: unittests | ||
if: always() |
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,30 @@ | ||
# conda environment description file for salishsea-site package testing environment | ||
# | ||
# Creates a conda environment in which the salishsea-site package unit tests and | ||
# coverage analysis can be run. | ||
# Primarily intended for creation of a conda env for use in a GitHub Actions workflow. | ||
|
||
name: salishsea-site-test | ||
|
||
channels: | ||
- conda-forge | ||
- defaults | ||
|
||
dependencies: | ||
- pip | ||
- pyyaml | ||
- requests | ||
|
||
# For unit tests and coverage monitoring | ||
- pytest | ||
- pytest-cov | ||
|
||
- pip: | ||
- arrow | ||
- attrs | ||
- pyramid | ||
- pyramid_debugtoolbar | ||
- pyramid_mako | ||
- sentry-sdk | ||
- supervisor | ||
- waitress |