From c8f439d183140375a98b31f4c97d2bbc4651ffa3 Mon Sep 17 00:00:00 2001 From: Mark Wardle Date: Wed, 20 Mar 2024 07:21:20 +0000 Subject: [PATCH] Don't cache data files for cron initiated workflow --- .github/workflows/test-live-uk-cron.yml | 56 +++++++++++++++++++++++++ .github/workflows/test-live-uk.yml | 4 +- 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test-live-uk-cron.yml diff --git a/.github/workflows/test-live-uk-cron.yml b/.github/workflows/test-live-uk-cron.yml new file mode 100644 index 00000000..f22090ef --- /dev/null +++ b/.github/workflows/test-live-uk-cron.yml @@ -0,0 +1,56 @@ +name: Test-uk-live + +on: + schedule: + - cron: '0 14 * * 3' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: DeLaGuardo/setup-clojure@master + with: + cli: latest + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Install dependencies + run: clojure -P -M:test + + - name: Compilation check + run: clojure -M:dev:check + + - name: Create TRUD cache directory + run: mkdir trud + + - name: Write out TRUD API key from secrets + run: echo ${{ secrets.TRUD_API_KEY }} >> api-key.txt + + - name: Install latest distributions for the UK + run: clojure -M:run --db snomed.db install uk.nhs/sct-clinical --api-key api-key.txt --cache-dir trud + + - name: Remove downloaded files + run: rm -rf trud + + - name: Index database + if: steps.cache-db.outputs.cache-hit != 'true' + run: clojure -M:run --db snomed.db index + + - name: Print status report + run: clojure -M:run --db snomed.db status + + - name: Clojure tests + run: clojure -M:test diff --git a/.github/workflows/test-live-uk.yml b/.github/workflows/test-live-uk.yml index cb890c32..836b95f7 100644 --- a/.github/workflows/test-live-uk.yml +++ b/.github/workflows/test-live-uk.yml @@ -4,8 +4,6 @@ on: pull_request: push: branches: [main] - schedule: - - cron: '0 14 * * 3' jobs: build: @@ -64,4 +62,4 @@ jobs: run: clojure -M:run --db snomed.db status - name: Clojure tests - run: clojure -M:test \ No newline at end of file + run: clojure -M:test