Merge branch 'migrate-to-pyproject-toml' into 'main' #20
This file contains hidden or 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
| name: Build and test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - release/** | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - release/** | |
| jobs: | |
| tarball: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get source code | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.x' | |
| - name: Install build requirements | |
| run: python -m pip install build wheel | |
| - name: Create distributions | |
| run: python -m build . --sdist --wheel --outdir . | |
| - uses: actions/upload-artifact@v2 | |
| with: | |
| name: tarball | |
| path: ligotimegps-*.tar.* | |
| - uses: actions/upload-artifact@v2 | |
| with: | |
| name: wheel | |
| path: ligotimegps*.whl | |
| build-and-test: | |
| name: Test ${{ matrix.python-version }} (${{ matrix.os }}) | |
| needs: | |
| - tarball | |
| # using bash makes things easier | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - macOS | |
| - Ubuntu | |
| - Windows | |
| python-version: | |
| - 3.6 | |
| - 3.7 | |
| - 3.8 | |
| - 3.9 | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - name: Get source code | |
| uses: actions/checkout@v2 | |
| - name: Download tarball | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: tarball | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install LIGOTimeGPS with test extras | |
| run: | | |
| TARBALL=$(ls ligotimegps-*.tar.*) | |
| python -m pip install ${TARBALL}[test] | |
| - name: Package list | |
| run: python -m pip list installed | |
| - name: Run test suite | |
| run: | | |
| python -m pytest \ | |
| -ra \ | |
| --color yes \ | |
| --cov ligotimegps \ | |
| --cov-report=xml \ | |
| --junitxml=pytest.xml \ | |
| --pyargs ligotimegps \ | |
| ; | |
| - name: Coverage report | |
| run: python -m coverage report --show-missing | |
| - name: Publish coverage to Codecov | |
| uses: codecov/[email protected] | |
| with: | |
| files: coverage.xml | |
| flags: ${{ runner.os }},python${{ matrix.python-version }} | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v2 | |
| with: | |
| name: pytest-conda-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: pytest.xml |