Skip to content

Remove the 'testing' module #215

Remove the 'testing' module

Remove the 'testing' module #215

Workflow file for this run

name: "CI"
on:
pull_request:
push:
branches:
- "main"
- "production"
env:
PRE_COMMIT_HOME: ".tox/pre-commit-home"
jobs:
lint:
name: "Lint"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repo"
uses: "actions/checkout@d632683dd7b4114ad314bca15554477dd762a938" # v4.2.0
- name: "Setup Python"
id: "setup-python"
uses: "actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3" # v5.2.0
with:
python-version: "3.12"
- name: "Detect Pythons"
uses: "kurtmckee/detect-pythons@38187a5464f266e93e5c1467699f7be2bf521d2e" # v1.1.0
- name: "Restore the cache"
id: "restore-cache"
uses: "actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" # v4.0.2
with:
path: |
.mypy_cache/
.tox/
.venv/
key: "lint-hash=${{ hashFiles('.github/workflows/ci.yaml', '.python-identifiers', 'pyproject.toml', 'tox.ini', 'requirements/*/*.txt') }}"
- name: "Create virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
.venv/bin/pip install --upgrade pip setuptools wheel
.venv/bin/pip install tox
- name: "Lint type annotations"
run: |
.venv/bin/tox -e mypy
- name: "Lint documentation"
run: |
.venv/bin/tox -e docs
build:
name: "Build a shared wheel"
runs-on: "ubuntu-latest"
outputs:
wheel-filename: "${{ steps.build-wheel.outputs.wheel-filename }}"
steps:
- name: "Checkout the repo"
uses: "actions/checkout@d632683dd7b4114ad314bca15554477dd762a938" # v4.2.0
- name: "Identify the week number"
run: |
date +'%U' > week-number.txt
date +'week-number=%U' >> "$GITHUB_ENV"
- name: "Setup Python"
id: "setup-python"
uses: "actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3" # v5.2.0
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
.github/workflows/ci.yaml
pyproject.toml
tox.ini
week-number.txt
- name: "Build the wheel"
id: "build-wheel"
run: |
pip wheel .
echo "wheel-filename=$(find globus_action_provider_tools-*.whl | head -n 1)" >> "$GITHUB_OUTPUT"
- name: "Upload the artifact"
uses: "actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874" # v4.4.0
with:
name: "globus_action_provider_tools-${{ github.sha }}.whl"
path: "${{ steps.build-wheel.outputs.wheel-filename }}"
retention-days: 1
test:
name: "Test ${{ matrix.python-version }}${{ matrix.tox-extras }} on ${{ matrix.os.name }}"
needs: ["build"]
runs-on: "${{ matrix.os.value }}"
strategy:
matrix:
# Broadly test supported Python versions on Linux.
os:
- name: "Linux"
value: "ubuntu-latest"
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
tox-extras: [""]
include:
# Test Windows.
- os:
name: "Windows"
value: "windows-latest"
python-version: "3.12"
tox-extras: ""
# Test Mac.
- os:
name: "Mac"
value: "macos-latest"
python-version: "3.12"
tox-extras: ""
# Test minimum dependencies.
- os:
name: "Linux"
value: "ubuntu-latest"
python-version: "3.8"
tox-extras: "-minimum_flask"
- os:
name: "Linux"
value: "ubuntu-latest"
python-version: "3.12"
tox-extras: "-minimum_flask"
steps:
- name: "Checkout the repo"
uses: "actions/checkout@d632683dd7b4114ad314bca15554477dd762a938" # v4.2.0
- name: "Identify the week number"
shell: "bash"
run: |
date +'%U' > week-number.txt
date +'week-number=%U' >> "$GITHUB_ENV"
- name: "Setup Python"
id: "setup-python"
uses: "actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3" # v5.2.0
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"
cache-dependency-path: |
.github/workflows/ci.yaml
pyproject.toml
tox.ini
week-number.txt
- name: "Restore cache"
id: "restore-cache"
uses: "actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" # v4.0.2
with:
path: |
.tox/
.venv/
key: >
test
week=${{ env.week-number }}
os=${{ matrix.os.value }}
python=${{ steps.setup-python.outputs.python-version }}
hash=${{ hashFiles('.github/workflows/ci.yaml', 'pyproject.toml', 'tox.ini') }}
- name: "Identify virtual environment path"
shell: "bash"
run: |
echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> "$GITHUB_ENV"
- name: "Install tox"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
${{ env.venv-path }}/pip install --upgrade pip setuptools wheel
${{ env.venv-path }}/pip install tox
- name: "Download the artifact"
uses: "actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16" # v4.1.8
with:
name: "globus_action_provider_tools-${{ github.sha }}.whl"
- name: "Test"
run: >
${{ env.venv-path }}/tox run
--installpkg="${{ needs.build.outputs.wheel-filename }}"
-e py${{ matrix.python-version}}${{ matrix.tox-extras }}