11name : Check release builds
22
33on :
4- workflow_dispatch :
54 push :
5+ branches :
6+ - " main"
7+ pull_request :
8+ merge_group :
69
710concurrency :
8- group : ${{ github.workflow }}-${{ github.ref }}
11+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github. ref }}
912 cancel-in-progress : true
1013
1114permissions :
@@ -32,31 +35,39 @@ jobs:
3235 runs-on : ${{ matrix.os }}
3336 timeout-minutes : 60
3437
38+ env :
39+ full-run : ${{ github.event_name == 'workflow_dispatch' || matrix.ghc-version == '9.6' }}
40+
3541 steps :
3642 - name : 📥 Checkout repository
43+ if : ${{ env.full-run }}
3744 uses : actions/checkout@v4
3845
3946 - name : 🗄️ Print Job info
47+ if : ${{ env.full-run }}
4048 run : |
4149 echo 'matrix.os: ${{ matrix.os }}'
4250 echo 'matrix.ghc-version: ${{ matrix.ghc-version }}'
4351 echo 'matrix.cabal-version: ${{ matrix.cabal-version }}'
4452 echo 'toJSON(matrix): ${{ toJSON(matrix) }}'
4553
4654 - name : 🛠️ Setup Haskell
55+ if : ${{ env.full-run }}
4756 id : setup-haskell
4857 uses : haskell-actions/setup@v2
4958 with :
5059 ghc-version : ${{ matrix.ghc-version }}
5160 cabal-version : ${{ matrix.cabal-version }}
5261
5362 - name : 🛠️ Setup system dependencies (Linux)
63+ if : ${{ env.full-run }}
5464 if : ${{ runner.os == 'Linux' }}
5565 run : sudo apt-get update && sudo apt-get -y install liburing-dev librocksdb-dev
5666 env :
5767 DEBIAN_FRONTEND : " noninteractive"
5868
5969 - name : 🛠️ Configure
70+ if : ${{ env.full-run }}
6071 run : |
6172 echo "packages: ./blockio/blockio.cabal ./lsm-tree.cabal" > cabal.project.temp
6273 cabal configure \
@@ -68,14 +79,15 @@ jobs:
6879 cat "cabal.project.temp.local"
6980
7081 - name : 💾 Generate Cabal plan
82+ if : ${{ env.full-run }}
7183 run : |
7284 cabal build all \
7385 --project-file="cabal.project.temp" \
7486 --dry-run
7587
7688 - name : 💾 Restore Cabal dependencies
7789 uses : actions/cache/restore@v4
78- if : ${{ !env.ACT }}
90+ if : ${{ !env.ACT && env.full-run }}
7991 id : cache-cabal
8092 env :
8193 key : check-release-build-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}
@@ -85,19 +97,21 @@ jobs:
8597 restore-keys : ${{ env.key }}-
8698
8799 - name : 🛠️ Build Cabal dependencies
100+ if : ${{ env.full-run }}
88101 run : |
89102 cabal build all \
90103 --project-file="cabal.project.temp" \
91104 --only-dependencies
92105
93106 - name : 💾 Save Cabal dependencies
94107 uses : actions/cache/save@v4
95- if : ${{ !env.ACT && steps.cache-cabal.outputs.cache-hit != 'true' }}
108+ if : ${{ !env.ACT && steps.cache-cabal.outputs.cache-hit != 'true' && env.full-run }}
96109 with :
97110 path : ${{ steps.setup-haskell.outputs.cabal-store }}
98111 key : ${{ steps.cache-cabal.outputs.cache-primary-key }}
99112
100113 - name : 🏗️ Build
114+ if : ${{ env.full-run }}
101115 run : |
102116 cabal build all \
103117 --project-file="cabal.project.temp"
0 commit comments