[pre-commit.ci] pre-commit autoupdate (#125) #224
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: Tests | |
on: | |
# NOTE: github.event context is push payload: | |
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push | |
push: | |
branches: | |
- main | |
- feature/** | |
# NOTE: github.event context is pull_request payload: | |
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request | |
pull_request: | |
concurrency: | |
# Concurrency group that uses the workflow name and PR number if available | |
# or commit SHA as a fallback. If a new build is triggered under that | |
# concurrency group while a previous build is running it will be canceled. | |
# Repeated pushes to a PR will cancel all previous builds, while multiple | |
# merges to main will not cancel. | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: "x64" | |
cache: "pip" | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
channels: defaults | |
activate-environment: test_env | |
auto-update-conda: false | |
auto-activate-base: false | |
show-channel-urls: true | |
- name: Source Scripts | |
run: | | |
set -x | |
# conda is our test dependency but can't be pip installed | |
conda install --quiet conda pip | |
pip install -e .[test] | |
conda info --json | |
echo "condarc" | |
cat ~/.condarc | |
echo "conda_pkgs_dir" | |
ls /home/runner/conda_pkgs_dir | |
echo "miniconda/pkgs" | |
ls /usr/share/miniconda/pkgs | |
echo "test_env" | |
ls /usr/share/miniconda/envs/test_env | |
pytest | |
analyze: | |
name: Analyze test results | |
needs: [linux] | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download test results | |
uses: actions/download-artifact@v4 | |
- name: Upload combined test results | |
# provides one downloadable archive of all .coverage/test-report.xml files | |
# of all matrix runs for further analysis. | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results-${{ github.sha }}-all | |
path: test-results-${{ github.sha }}-* | |
retention-days: 90 # default: 90 | |
- name: Test Summary | |
uses: test-summary/action@v2 | |
with: | |
paths: ./test-results-${{ github.sha }}-**/test-report*.xml | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} |