From ef53a054213842ba8085931d28dfdff012382150 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 09:55:31 +0200 Subject: [PATCH 1/9] feat(ci): add cache capabilities. --- .github/workflows/style.yml | 4 ++++ .github/workflows/test-ci.yml | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 9180d6f2..619c4c75 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ "master" ] + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + workflow_dispatch: env: diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index 72b708a4..b403f981 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ "master" ] + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + workflow_dispatch: env: @@ -166,6 +170,12 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} cache: pip + - name: Restore cached brainweb-dl directory + uses: actions/cache/restore@v4 + with: + path: ~/.cache/brainweb + key: ${{ runner.os }}-${{ hashfiles("~/.cache/brainweb/**.npy") }} + - name: Install Python deps shell: bash run: | @@ -179,6 +189,12 @@ jobs: export COVERAGE_FILE=coverage_plots pytest examples tests -k="not operators" --cov --cov-branch --cov-report=term + - name: Cache brainweb-dl directory + uses: actions/cache/save@v4 + with: + path: ~/.cache/brainweb + key: ${{ runner.os }}-${{ hashfiles("~/.cache/brainweb/**.npy") }} + - name: Upload coverage if: success() uses: actions/upload-artifact@v3 From b1eba72b1e51eeb5668c7157538969fb511705e0 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 10:05:39 +0200 Subject: [PATCH 2/9] fix(ci): remove concurrency for linting --- .github/workflows/style.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 619c4c75..15495bde 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -6,9 +6,6 @@ on: pull_request: branches: [ "master" ] - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true workflow_dispatch: From 640f0b197d43b7e2e84aac5cc2ac96e0cc64d3d7 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 10:09:46 +0200 Subject: [PATCH 3/9] fix(ci): correct concurrency use. --- .github/workflows/style.yml | 4 ++++ .github/workflows/test-ci.yml | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 15495bde..a8b2e33b 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,6 +9,10 @@ on: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: PYTHON_VERSION: "3.10" BART_VERSION: "0.8.00" diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index b403f981..2322a9a6 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -6,12 +6,13 @@ on: pull_request: branches: [ "master" ] - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: PYTHON_VERSION: "3.10" BART_VERSION: "0.8.00" From 1741e00e1789fb1012ee4f8e5b01bdf1b596d073 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 10:16:56 +0200 Subject: [PATCH 4/9] fix ci --- .github/workflows/test-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index 2322a9a6..f92f3d33 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -194,7 +194,7 @@ jobs: uses: actions/cache/save@v4 with: path: ~/.cache/brainweb - key: ${{ runner.os }}-${{ hashfiles("~/.cache/brainweb/**.npy") }} + key: ${{ runner.os }}-${{ hashfiles('~/.cache/brainweb/**.npy') }} - name: Upload coverage if: success() From e57680bf09aea51ea56c4025d57b9d2f5f9adc50 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 10:22:31 +0200 Subject: [PATCH 5/9] fix ci --- .github/workflows/test-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index f92f3d33..0a3f9e4c 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -175,7 +175,7 @@ jobs: uses: actions/cache/restore@v4 with: path: ~/.cache/brainweb - key: ${{ runner.os }}-${{ hashfiles("~/.cache/brainweb/**.npy") }} + key: ${{ runner.os }}-${{ hashfiles('home/runner/.cache/brainweb/**.npy') }} - name: Install Python deps shell: bash @@ -194,7 +194,7 @@ jobs: uses: actions/cache/save@v4 with: path: ~/.cache/brainweb - key: ${{ runner.os }}-${{ hashfiles('~/.cache/brainweb/**.npy') }} + key: ${{ runner.os }}-${{ hashfiles('/home/runner/.cache/brainweb/**.npy') }} - name: Upload coverage if: success() From 02669165427d381101d4efc4c666871747c2b2e3 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 10:47:14 +0200 Subject: [PATCH 6/9] trigger ci From 23d2d5cbe9e0a1e7c8b2a6e798ab630ffe891f1c Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 10:57:18 +0200 Subject: [PATCH 7/9] fix: rename cache file --- .github/workflows/test-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index 0a3f9e4c..60d7f97a 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -173,9 +173,10 @@ jobs: - name: Restore cached brainweb-dl directory uses: actions/cache/restore@v4 + id: cache-restore with: path: ~/.cache/brainweb - key: ${{ runner.os }}-${{ hashfiles('home/runner/.cache/brainweb/**.npy') }} + key: ${{ runner.os }}-Brainweb}} - name: Install Python deps shell: bash @@ -192,9 +193,10 @@ jobs: - name: Cache brainweb-dl directory uses: actions/cache/save@v4 + if: cache-restore.outputs.cache-hit != 'true' with: path: ~/.cache/brainweb - key: ${{ runner.os }}-${{ hashfiles('/home/runner/.cache/brainweb/**.npy') }} + key: ${{ runner.os }}-Brainweb}} - name: Upload coverage if: success() From 09ce939f7624bdbd8d1f0ccb2c40a5e4e9208796 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 11:00:06 +0200 Subject: [PATCH 8/9] correct trigger --- .github/workflows/test-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index 60d7f97a..6fd9ec26 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -193,7 +193,7 @@ jobs: - name: Cache brainweb-dl directory uses: actions/cache/save@v4 - if: cache-restore.outputs.cache-hit != 'true' + if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} with: path: ~/.cache/brainweb key: ${{ runner.os }}-Brainweb}} From ad382cc109f2498efd7d2f429b0bf32692c4d78d Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 6 Jun 2024 11:02:13 +0200 Subject: [PATCH 9/9] fix name --- .github/workflows/test-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index 6fd9ec26..6a29d204 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -176,7 +176,7 @@ jobs: id: cache-restore with: path: ~/.cache/brainweb - key: ${{ runner.os }}-Brainweb}} + key: ${{ runner.os }}-Brainweb - name: Install Python deps shell: bash @@ -196,7 +196,7 @@ jobs: if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} with: path: ~/.cache/brainweb - key: ${{ runner.os }}-Brainweb}} + key: ${{ runner.os }}-Brainweb - name: Upload coverage if: success()