Skip to content

Commit

Permalink
Refactor ci-release.yml (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
anissa111 committed Jun 21, 2024
1 parent 861110b commit 04accb2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ concurrency:
cancel-in-progress: true

jobs:
test:
test_conda_release:
if: github.repository == 'NCAR/geocat-comp' && github.ref == 'refs/heads/main'
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
name: Conda python${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
Expand All @@ -34,6 +33,8 @@ jobs:
environment-name: import_test
create-args: >-
python=${{ matrix.python-version }}
cache-environment: true
cache-environment-key: "release_test-${{runner.os}}-py${{matrix.python-version}}-${{steps.date.outputs.date}}"

- name: retry environment setup if failed
if: steps.env-setup.outcome == 'failure'
Expand All @@ -43,6 +44,8 @@ jobs:
environment-name: import_test
create-args: >-
python=${{ matrix.python-version }}
cache-environment: true
cache-environment-key: "release_test-${{runner.os}}-py${{matrix.python-version}}-${{steps.date.outputs.date}}"

- name: Try conda release
run: |
Expand All @@ -52,9 +55,42 @@ jobs:
micromamba activate import_test
python -c "import geocat.comp"
- name: Uninstall conda release
run: |
micromamba remove geocat-comp -y
test_pypi_release:
if: github.repository == 'NCAR/geocat-comp' && github.ref == 'refs/heads/main'
name: PyPI python${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: environment set up
id: env-setup
continue-on-error: true
uses: mamba-org/setup-micromamba@v1
with:
environment-name: import_test
create-args: >-
python=${{ matrix.python-version }}
cache-environment: true
cache-environment-key: "release_test-${{runner.os}}-py${{matrix.python-version}}-${{steps.date.outputs.date}}"

- name: retry environment setup if failed
if: steps.env-setup.outcome == 'failure'
uses: mamba-org/setup-micromamba@v1
with:
download-micromamba: false
environment-name: import_test
create-args: >-
python=${{ matrix.python-version }}
cache-environment: true
cache-environment-key: "release_test-${{runner.os}}-py${{matrix.python-version}}-${{steps.date.outputs.date}}"

- name: Try PyPI release
run: |
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Internal Changes
* Remove ASV version pin and pin Conda version for benchmarking workflow by `Katelyn FitzGerald`_ in (:pr:`610`)
* Updates to issue and PR templates by `Anissa Zacharias`_ in (:pr:`612`)
* Re-pin ASV and list env info by `Katelyn FitzGerald`_ in (:pr:`613`)
* Refactor ``pre-commit.ci`` by `Anissa Zacharias`_ in (:pr:`628`)

v2024.04.0 (April 23, 2024)
---------------------------
Expand Down

0 comments on commit 04accb2

Please sign in to comment.