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
Showing
5 changed files
with
86 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
tests: | ||
name: "py${{ matrix.python-version }} / ${{ matrix.os }} / extras: ${{ matrix.extras }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9"] | ||
extras: [true] | ||
os: ["ubuntu-latest"] | ||
include: | ||
- python-version: "3.8" | ||
extras: false | ||
os: "ubuntu-latest" | ||
- python-version: "3.8" | ||
extras: true | ||
os: "macos-latest" | ||
- python-version: "3.8" | ||
extras: true | ||
os: "windows-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
if: ${{ matrix.extras }} | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -e ".[extras,tests]" | ||
- name: Install dependencies without extras | ||
if: ${{ !matrix.extras }} | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -e ".[tests]" | ||
- name: Run tests | ||
run: | | ||
python -m pytest -v src/emcee/tests --cov emcee | ||
- name: Get unique id | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
id: unique-id | ||
env: | ||
STRATEGY_CONTEXT: ${{ toJson(strategy) }} | ||
run: | | ||
export JOB_ID=`echo $STRATEGY_CONTEXT | md5sum` | ||
echo "::set-output name=id::$JOB_ID" | ||
- uses: actions/upload-artifact@v2 | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
with: | ||
name: cov-${{ steps.unique-id.outputs.id }} | ||
path: .coverage | ||
|
||
coverage: | ||
name: "Merge and upload coverage" | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v2 | ||
- name: Merge and upload coverage | ||
run: | | ||
python -m pip install coveralls | ||
find . -name \.coverage -exec coverage combine --append {} \; | ||
coveralls | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github_token }} |
This file was deleted.
Oops, something went wrong.
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