From 2e9fa503f28191a074ed88ac46e7cdd5c37bb505 Mon Sep 17 00:00:00 2001 From: Taylor Denouden Date: Wed, 15 Feb 2023 09:52:32 -0500 Subject: [PATCH 1/3] Add macos-latest to test matrix --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 6381ff6..60b17cc 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ "ubuntu-latest", "windows-latest" ] + os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] python-version: [ "3.7", "3.8", "3.9", "3.10" ] include: - os: ubuntu-latest From ea3211fea22cd0199e2c6bd2fae2b983ac2fae05 Mon Sep 17 00:00:00 2001 From: Taylor Denouden Date: Wed, 15 Feb 2023 09:59:02 -0500 Subject: [PATCH 2/3] Fix missing os info --- .github/workflows/unit-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 60b17cc..6982329 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -29,6 +29,10 @@ jobs: label: win-64 prefix: C:\Miniconda3\envs\my-env + - os: macos-latest + label: macos-64 + prefix: /usr/local/miniconda3/envs/my-env + runs-on: ${{ matrix.os }} defaults: run: From de76149115771ff18c9bd11771b771f9664ded58 Mon Sep 17 00:00:00 2001 From: Taylor Denouden Date: Wed, 15 Feb 2023 10:15:57 -0500 Subject: [PATCH 3/3] Simplify caching setup --- .github/workflows/unit-test.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index a613cf7..213e978 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -20,18 +20,6 @@ jobs: matrix: os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] python-version: [ "3.7", "3.8", "3.9", "3.10" ] - include: - - os: ubuntu-latest - label: linux-64 - prefix: /usr/share/miniconda3/envs/my-env - - - os: windows-latest - label: win-64 - prefix: C:\Miniconda3\envs\my-env - - - os: macos-latest - label: macos-64 - prefix: /usr/local/miniconda3/envs/my-env runs-on: ${{ matrix.os }} defaults: @@ -49,13 +37,21 @@ jobs: activate-environment: my-env use-mamba: true - - name: Set cache date - run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV + - name: Get Date + id: get-date + run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT + shell: bash - - uses: actions/cache@v3 + - name: Cache Conda env + uses: actions/cache@v3 with: - path: ${{ matrix.prefix }} - key: ${{ matrix.label }}-py${{ matrix.python-version }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} + path: ${{ env.CONDA }}/envs + key: + conda-${{ runner.os }}--${{ runner.arch }}--py${{ matrix.python-version }}--${{ + steps.get-date.outputs.today }}-${{hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER}} + env: + # Increase this value to reset cache if environment.yml has not changed + CACHE_NUMBER: 0 id: cache - name: Update environment