From b58aa589b915210acedff385d77b42a9a5b67d9e Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 24 Oct 2021 15:10:00 +0100 Subject: [PATCH 1/5] attempt to fix hiedb lock errors it looks like the test runner has a preexisting process locking the hiedb --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8fda76503..1a9d9fc45e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -138,6 +138,10 @@ jobs: sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ src/**/*.hs exe/*.hs + # this is only safe if the test environment is isolated + - name: clean ide cache + run: rm -rf ~/.cache/ghcide + - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} name: Build # Retry it three times to workaround compiler segfaults in windows From e60f9fe4c89387a6b426104cf18eef60c19c11ec Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 24 Oct 2021 16:51:25 +0100 Subject: [PATCH 2/5] Move ghcide cache to the tmp folder --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a9d9fc45e..55fef1a346 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,8 @@ jobs: test: needs: pre_job runs-on: ${{ matrix.os }} + env: + XDG_CACHE_HOME: /tmp/ghcide strategy: fail-fast: true matrix: @@ -140,7 +142,9 @@ jobs: # this is only safe if the test environment is isolated - name: clean ide cache - run: rm -rf ~/.cache/ghcide + run: | + rm -rf ~/.cache/ghcide + rm -rf $XDG_CACHE_HOME/ghcide - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} name: Build From 1adb01fdc131b08e4574ff9d39982fb1957d992b Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 24 Oct 2021 19:27:17 +0100 Subject: [PATCH 3/5] Use ${{ runner.temp }} --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55fef1a346..4de0cb5c1a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: needs: pre_job runs-on: ${{ matrix.os }} env: - XDG_CACHE_HOME: /tmp/ghcide + XDG_CACHE_HOME: ${{ runner.temp }}/ghcide strategy: fail-fast: true matrix: From 9ee945ea2586c02a1fddd8d44cfde883f9fbd254 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 24 Oct 2021 19:50:07 +0100 Subject: [PATCH 4/5] clean up the hie-bios cache too --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4de0cb5c1a..1633bf4ecf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: needs: pre_job runs-on: ${{ matrix.os }} env: - XDG_CACHE_HOME: ${{ runner.temp }}/ghcide + XDG_CACHE_HOME: ${{ runner.temp }}/cache strategy: fail-fast: true matrix: @@ -144,7 +144,9 @@ jobs: - name: clean ide cache run: | rm -rf ~/.cache/ghcide + rm -rf ~/.cache/hie-bios rm -rf $XDG_CACHE_HOME/ghcide + rm -rf $XDG_CACHE_HOME/hie-bios - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} name: Build From f3f13fdb44bada8893ea40bf1a8ba2fc990c12e1 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Mon, 25 Oct 2021 15:32:21 +0100 Subject: [PATCH 5/5] The runner context doesn't exist outside the steps section --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1633bf4ecf..428a035800 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,8 +30,6 @@ jobs: test: needs: pre_job runs-on: ${{ matrix.os }} - env: - XDG_CACHE_HOME: ${{ runner.temp }}/cache strategy: fail-fast: true matrix: @@ -141,8 +139,9 @@ jobs: src/**/*.hs exe/*.hs # this is only safe if the test environment is isolated - - name: clean ide cache + - name: setup ide cache run: | + export XDG_CACHE_HOME=$RUNNER_TEMP/cache rm -rf ~/.cache/ghcide rm -rf ~/.cache/hie-bios rm -rf $XDG_CACHE_HOME/ghcide