From 3aa4e1994a134b605675f792647451b6ced5a516 Mon Sep 17 00:00:00 2001 From: Tom Aarsen Date: Mon, 6 Dec 2021 18:08:15 +0100 Subject: [PATCH 1/3] Allow commits to not use the CI Cache if /nocache is used in the commit message --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fafe82176..c1f22ac6c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,6 +42,7 @@ jobs: with: path: ~/nltk_data key: nltk_data_${{ secrets.CACHE_VERSION }} + if: !contains(github.event.head_commit.message, '/nocache') - name: Download nltk data packages on cache miss run: | @@ -64,6 +65,7 @@ jobs: with: path: ~/third key: third_${{ secrets.CACHE_VERSION }} + if: !contains(github.event.head_commit.message, '/nocache') - name: Download third party data run: | @@ -101,6 +103,7 @@ jobs: with: path: ${{ env.pythonLocation }} key: python-dependencies-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements-ci.txt') }}-${{ env.pythonLocation }} + if: !contains(github.event.head_commit.message, '/nocache') - name: Install dependencies on cache miss run: | From c7f895ddb7d8e8d28fb12f8a2c50c220534d80ae Mon Sep 17 00:00:00 2001 From: Tom Aarsen Date: Mon, 6 Dec 2021 18:11:51 +0100 Subject: [PATCH 2/3] Wrapped and moved conditional --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c1f22ac6c8..60e025af92 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,12 +37,12 @@ jobs: uses: actions/checkout@v2 - name: Cache nltk data + if: ${{ !contains(github.event.head_commit.message, '/nocache') }} uses: actions/cache@v2 id: restore-cache with: path: ~/nltk_data key: nltk_data_${{ secrets.CACHE_VERSION }} - if: !contains(github.event.head_commit.message, '/nocache') - name: Download nltk data packages on cache miss run: | @@ -60,12 +60,12 @@ jobs: uses: actions/checkout@v2 - name: Cache third party tools + if: ${{ !contains(github.event.head_commit.message, '/nocache') }} uses: actions/cache@v2 id: restore-cache with: path: ~/third key: third_${{ secrets.CACHE_VERSION }} - if: !contains(github.event.head_commit.message, '/nocache') - name: Download third party data run: | @@ -98,12 +98,12 @@ jobs: if: runner.os == 'Linux' - name: Cache dependencies + if: ${{ !contains(github.event.head_commit.message, '/nocache') }} uses: actions/cache@v2 id: restore-cache with: path: ${{ env.pythonLocation }} key: python-dependencies-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements-ci.txt') }}-${{ env.pythonLocation }} - if: !contains(github.event.head_commit.message, '/nocache') - name: Install dependencies on cache miss run: | From 1d22dd8ed485ec9436013d532a3ca828ac92359d Mon Sep 17 00:00:00 2001 From: Tom Aarsen Date: Mon, 6 Dec 2021 18:38:38 +0100 Subject: [PATCH 3/3] Previous commit failed due to cache, so: /nocache Hopefully this will force the CI to invalidate the cache