Update Contributing guide #234
Workflow file for this run
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
name: Build and Test | |
# Run this workflow whenever a PR is created or pushed to. | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
fail-fast: False | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches | |
- name: Unshallow checkout | |
run: git fetch --prune --unshallow | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
docker version | |
sudo apt-get update | |
sudo apt-get install -y musl-tools | |
ci/test_setup.sh | |
- name: Lint | |
run: | | |
mypy | |
- name: Build | |
run: | | |
python -m build | |
- name: Run tests | |
run: | | |
# Make sure we only use the wheel | |
rm -r scuba scubainit | |
pip install dist/scuba-*-py3-none-any.whl | |
./run_unit_tests.sh | |
./run_full_tests.py | |
- name: Upload Unit Test Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Unit Test Results (Python ${{ matrix.python-version }}) | |
path: unit-test-results.xml | |
# https://github.com/marketplace/actions/publish-unit-test-results#use-with-matrix-strategy | |
publish-test-results: | |
name: "Publish Unit Tests Results" | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
# the build-and-test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: artifacts/**/*.xml |