Extending stale GHA time #95
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
# reference: | |
# - https://github.com/actions/cache | |
# - https://github.com/actions/checkout | |
name: ci-wheels | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
- "v*x" | |
- "!conda-lock-auto-update" | |
- "!pre-commit-ci-update-config" | |
- "!dependabot/*" | |
tags: | |
- "v*" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-artifacts: | |
name: "build pypi artifacts" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "build sdist and whell" | |
run: | | |
pipx run build | |
- name: "show sdist and wheel" | |
run: | | |
ls -l ${{ github.workspace }}/dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
test-artifacts: | |
needs: [build-artifacts] | |
name: "test wheel (${{ matrix.python-version }})" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
ENV_CACHE_BUILD: "0" | |
#: If you change the IRIS_SOURCE here you will also need to change it in | |
#: the noxfile and the tests and benchmark workflows. | |
IRIS_SOURCE: "github:main" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10"] | |
session: ["wheel"] | |
steps: | |
- name: "checkout" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
- name: Install Nox | |
run: | | |
pip install nox | |
- name: Cache environment directories | |
id: cache-env-dir | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.nox | |
$CONDA/pkgs | |
key: ${{ runner.os }}-${{ hashFiles('requirements/') }}-${{ env.ENV_CACHE_BUILD }}-${{ env.IRIS_SOURCE }}-${{ matrix.python-version }} | |
- name: "nox install and test wheel" | |
env: | |
PY_VER: ${{ matrix.python-version }} | |
run: | | |
nox --session ${{ matrix.session }} -- --verbose | |
show-artifacts: | |
needs: [build-artifacts] | |
name: "show artifacts" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
- shell: bash | |
run: | | |
ls -l ${{ github.workspace }}/dist | |
publish-artifacts-test-pypi: | |
needs: [test-artifacts] | |
name: "Publish to Test PyPI" | |
runs-on: ubuntu-latest | |
# upload to Test PyPI for every commit on main branch | |
# and check for the SciTools repo | |
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'SciTools-incubator' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
print_hash: true | |
publish-artifacts-pypi: | |
needs: [test-artifacts] | |
name: "Publish to PyPI" | |
runs-on: ubuntu-latest | |
# upload to PyPI for every tag starting with 'v' | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && github.repository_owner == 'SciTools-incubator' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
print_hash: true |