@@ -18,30 +18,31 @@ env:
1818 MINIO_ACCESS_KEY: minio
1919 MINIO_SECRET_KEY: minio123
2020 MINIO_LOCAL: 1
21− MINIO_SECURE: 1
2221
2322jobs:
2423 ormolu:
2524 runs-on: ubuntu-latest
2625 steps:
27− - uses: actions/checkout@v3
28− - uses: mrkkrp/ormolu-action@v8
26+ - uses: actions/checkout@v4
27+ - uses: haskell-actions/run-ormolu@v15
28+ with:
29+ version: "0.5.0.1"
2930
3031 hlint:
3132 runs-on: ubuntu-latest
3233 steps:
33− - uses: actions/checkout@v3
34+ - uses: actions/checkout@v4
3435
35− - name: 'Set up HLint'
36− uses: haskell/actions/hlint-setup@v2
37− with:
38− version: '3.5'
36+ - name: "Set up HLint"
37+ uses: haskell-actions/hlint-setup@v2
38+ with:
39+ version: "3.5"
3940
40− - name: 'Run HLint'
41− uses: haskell/actions/hlint-run@v2
42− with:
43− path: '["src/", "test/", "examples"]'
44− fail-on: warning
41+ - name: "Run HLint"
42+ uses: haskell-actions/hlint-run@v2
43+ with:
44+ path: '["src/", "test/", "examples"]'
45+ fail-on: warning
4546
4647 cabal:
4748 name: ${{ matrix.os }} / ghc-${{ matrix.ghc }} / cabal-${{ matrix.cabal }}
@@ -49,180 +50,217 @@ jobs:
4950 needs: ormolu
5051 strategy:
5152 matrix:
52− os: [ubuntu-latest, windows-latest] # Removed macos-latest due to cert issues.
53− cabal: ["3.6", "3.8", "latest"]
53+ os: [ubuntu-latest, windows-latest, macos-latest]
54+ cabal: ["3.8", "latest"]
5455 ghc:
56+ - "9.8"
57+ - "9.6"
5558 - "9.4"
5659 - "9.2"
5760 - "9.0"
5861 - "8.10"
59− - "8.8"
60− - "8.6"
6162 exclude:
62− - os: windows-latest
63− ghc: "9.4"
64− cabal: "3.6"
63+ # macos llvm issue for versions less than 9.2
64+ - os: macos-latest
65+ ghc: "8.10"
66+ - os: macos-latest
67+ ghc: "9.0"
68+ # Cabal 3.8 supports GHC < 9.6
69+ - cabal: "3.8"
70+ ghc: "9.6"
71+ - cabal: "3.8"
72+ ghc: "9.8"
6573
6674 steps:
67− - uses: actions/checkout@v3
68− if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
69−
70− - uses: haskell/actions/setup@v2
71− id: setup-haskell-cabal
72− name: Setup Haskell
73− with:
74− ghc-version: ${{ matrix.ghc }}
75− cabal-version: ${{ matrix.cabal }}
76−
77− - name: Configure
78− run: |
79− cabal configure --enable-tests --enable-benchmarks --test-show-details=direct -fexamples -fdev -flive-test
80−
81− - name: Freeze
82− run: |
83− cabal freeze
84−
85− - uses: actions/cache@v3
86− name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
87− with:
88− path: |
89− ~/.cabal/packages
90− ~/.cabal/store
91− dist-newstyle
92− key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
93− restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
94−
95− - name: Install dependencies
96− run: |
97− cabal build --only-dependencies
98−
99− - name: Build
100− run: |
101− cabal build
102−
103− - name: Setup MinIO for testing (Linux)
104− if: matrix.os == 'ubuntu-latest'
105− run: |
106− mkdir -p /tmp/minio /tmp/minio-config/certs
107− cp test/cert/* /tmp/minio-config/certs/
108− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
109− sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
110− sudo update-ca-certificates
111−
112− - name: Setup MinIO for testing (MacOS)
113− if: matrix.os == 'macos-latest'
114− run: |
115− mkdir -p /tmp/minio /tmp/minio-config/certs
116− cp test/cert/* /tmp/minio-config/certs/
117− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
118− sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
119−
120− - name: Setup MinIO for testing (Windows)
121− if: matrix.os == 'windows-latest'
122− run: |
123− New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
124− Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
125− Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
126− Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
127−
128− - name: Test (Non-Windows)
129− if: matrix.os != 'windows-latest'
130− run: |
131− /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
132− ghc --version
133− cabal --version
134− cabal test
135−
136− - name: Test (Windows)
137− if: matrix.os == 'windows-latest'
138− run: |
139− Start-Process -NoNewWindow -FilePath "$HOME/minio.exe" -ArgumentList "--certs-dir", "$env:temp/minio-config/certs", "server", "$env:temp/data1", "$env:temp/data2", "$env:temp/data3", "$env:temp/data4"
140− ghc --version
141− cabal --version
142− cabal test
75+ - uses: actions/checkout@v4
76+ if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
77+
78+ - uses: haskell-actions/setup@v2
79+ id: setup
80+ name: Setup Haskell
81+ with:
82+ ghc-version: ${{ matrix.ghc }}
83+ cabal-version: ${{ matrix.cabal }}
84+ cabal-update: true
85+
86+ - name: Configure
87+ run: |
88+ cabal configure --enable-tests --enable-benchmarks --test-show-details=direct -fexamples -fdev -flive-test
89+ cabal build all --dry-run
90+ # The last step generates dist-newstyle/cache/plan.json for the cache key.
91+
92+ - name: Restore cached dependencies
93+ uses: actions/cache/restore@v4
94+ id: cache
95+ env:
96+ key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
97+ with:
98+ path: ${{ steps.setup.outputs.cabal-store }}
99+ key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
100+ restore-keys: ${{ env.key }}-
101+
102+ - name: Install dependencies
103+ # If we had an exact cache hit, the dependencies will be up to date.
104+ if: steps.cache.outputs.cache-hit != 'true'
105+ run: cabal build all --only-dependencies
106+
107+ # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
108+ - name: Save cached dependencies
109+ uses: actions/cache/save@v4
110+ # If we had an exact cache hit, trying to save the cache would error because of key clash.
111+ if: steps.cache.outputs.cache-hit != 'true'
112+ with:
113+ path: ${{ steps.setup.outputs.cabal-store }}
114+ key: ${{ steps.cache.outputs.cache-primary-key }}
115+
116+ - name: Build
117+ run: |
118+ cabal build all
119+
120+ - name: Setup TLS certs for MinIO for testing (Linux)
121+ if: matrix.os == 'ubuntu-latest'
122+ run: |
123+ mkdir -p /tmp/minio /tmp/minio-config/certs
124+ cp test/cert/* /tmp/minio-config/certs/
125+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
126+ sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
127+ sudo update-ca-certificates
128+
129+ ## Currently disable TLS setup for MacOS due to issues in trusting it on MacOS.
130+ - name: Setup TLS certs for MinIO for testing (MacOS)
131+ if: matrix.os == 'macos-latest'
132+ run: |
133+ mkdir -p /tmp/minio /tmp/minio-config/certs
134+ cp test/cert/* /tmp/minio-config/certs/
135+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
136+ # sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
137+
138+ - name: Setup MinIO for testing (Windows)
139+ if: matrix.os == 'windows-latest'
140+ run: |
141+ New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
142+ Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
143+ Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
144+ Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
145+
146+ - name: Test (Linux)
147+ if: matrix.os == 'ubuntu-latest'
148+ env:
149+ MINIO_SECURE: 1
150+ run: |
151+ /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
152+ ghc --version
153+ cabal --version
154+ cabal test all
155+
156+ - name: Test (MacOS)
157+ if: matrix.os == 'macos-latest'
158+ # # Leave MINIO_SECURE unset to disable TLS in tests.
159+ # env:
160+ # MINIO_SECURE: 1
161+ run: |
162+ /tmp/minio/minio server --quiet data1 data2 data3 data4 2>&1 > minio.log &
163+ ghc --version
164+ cabal --version
165+ cabal test all
166+
167+ - name: Test (Windows)
168+ if: matrix.os == 'windows-latest'
169+ env:
170+ MINIO_SECURE: 1
171+ run: |
172+ Start-Process -NoNewWindow -FilePath "$HOME/minio.exe" -ArgumentList "--certs-dir", "$env:temp/minio-config/certs", "server", "$env:temp/data1", "$env:temp/data2", "$env:temp/data3", "$env:temp/data4"
173+ ghc --version
174+ cabal --version
175+ cabal test all
143176
144177 stack:
145178 name: stack / ghc ${{ matrix.ghc }}
146179 runs-on: ${{ matrix.os }}
180+ env:
181+ MINIO_SECURE: 1
147182 strategy:
148183 matrix:
149184 ghc:
150185 - "8.10.7"
151186 - "9.0.2"
152− - "9.2.4"
187+ - "9.2.8"
188+ - "9.4.8"
189+ - "9.6.5"
190+ - "9.8.2"
153191 os: [ubuntu-latest]
154192
155193 steps:
156− - uses: actions/checkout@v3
157− if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
158−
159− - uses: haskell/actions/setup@v2
160− name: Setup Haskell Stack
161− with:
162− enable-stack: true
163− ghc-version: ${{ matrix.ghc }}
164− stack-version: 'latest'
165−
166− - uses: actions/cache@v3
167− name: Cache ~/.stack
168− with:
169− path: ~/.stack
170− key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
171− restore-keys: |
172− ${{ runner.os }}-stack-global-
173− - uses: actions/cache@v3
174− name: Cache .stack-work
175− with:
176− path: .stack-work
177− key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
178− restore-keys: |
179− ${{ runner.os }}-stack-work-
180−
181− - name: Install dependencies
182− run: |
183− stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
184−
185− - name: Build
186− run: |
187− stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples --flag minio-hs:live-test --flag minio-hs:dev
188−
189− - name: Setup MinIO for testing (Linux)
190− if: matrix.os == 'ubuntu-latest'
191− run: |
192− mkdir -p /tmp/minio /tmp/minio-config/certs
193− cp test/cert/* /tmp/minio-config/certs/
194− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
195− sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
196− sudo update-ca-certificates
197−
198− - name: Setup MinIO for testing (MacOS)
199− if: matrix.os == 'macos-latest'
200− run: |
201− mkdir -p /tmp/minio /tmp/minio-config/certs
202− cp test/cert/* /tmp/minio-config/certs/
203− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
204− sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
205−
206− - name: Setup MinIO for testing (Windows)
207− if: matrix.os == 'windows-latest'
208− run: |
209− New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
210− Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
211− Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
212− Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
213−
214− - name: Test (Non-Windows)
215− if: matrix.os != 'windows-latest'
216− run: |
217− /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
218− ghc --version
219− stack --version
220− stack test --system-ghc --flag minio-hs:live-test --flag minio-hs:dev
221−
222− - name: Test (Windows)
223− if: matrix.os == 'windows-latest'
224− run: |
225− Start-Process -NoNewWindow -FilePath "$HOME/minio.exe" -ArgumentList "--certs-dir", "$env:temp/minio-config/certs", "server", "$env:temp/data1", "$env:temp/data2", "$env:temp/data3", "$env:temp/data4"
226− ghc --version
227− cabal --version
228− stack test --system-ghc --flag minio-hs:live-test --flag minio-hs:dev
194+ - uses: actions/checkout@v4
195+ if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
196+
197+ - uses: haskell-actions/setup@v2
198+ with:
199+ ghc-version: ${{ matrix.ghc }}
200+ enable-stack: true
201+ stack-version: "latest"
202+
203+ - uses: actions/cache@v4
204+ name: Cache ~/.stack
205+ with:
206+ path: ~/.stack
207+ key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
208+ restore-keys: |
209+ ${{ runner.os }}-stack-global-
210+ - uses: actions/cache@v4
211+ name: Cache .stack-work
212+ with:
213+ path: .stack-work
214+ key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
215+ restore-keys: |
216+ ${{ runner.os }}-stack-work-
217+
218+ - name: Install dependencies
219+ run: |
220+ stack --version
221+ stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
222+
223+ - name: Build
224+ run: |
225+ stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples --flag minio-hs:live-test --flag minio-hs:dev
226+
227+ - name: Setup MinIO for testing (Linux)
228+ if: matrix.os == 'ubuntu-latest'
229+ run: |
230+ mkdir -p /tmp/minio /tmp/minio-config/certs
231+ cp test/cert/* /tmp/minio-config/certs/
232+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
233+ sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
234+ sudo update-ca-certificates
235+
236+ - name: Setup MinIO for testing (MacOS)
237+ if: matrix.os == 'macos-latest'
238+ run: |
239+ mkdir -p /tmp/minio /tmp/minio-config/certs
240+ cp test/cert/* /tmp/minio-config/certs/
241+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
242+ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
243+
244+ - name: Setup MinIO for testing (Windows)
245+ if: matrix.os == 'windows-latest'
246+ run: |
247+ New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
248+ Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
249+ Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
250+ Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
251+
252+ - name: Test (Non-Windows)
253+ if: matrix.os != 'windows-latest'
254+ run: |
255+ /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
256+ ghc --version
257+ stack --version
258+ stack test --system-ghc --flag minio-hs:live-test --flag minio-hs:dev
259+
260+ - name: Test (Windows)
261+ if: matrix.os == 'windows-latest'
262+ run: |
263+ Start-Process -NoNewWindow -FilePath "$HOME/minio.exe" -ArgumentList "--certs-dir", "$env:temp/minio-config/certs", "server", "$env:temp/data1", "$env:temp/data2", "$env:temp/data3", "$env:temp/data4"
264+ ghc --version
265+ cabal --version
266+ stack test --system-ghc --flag minio-hs:live-test --flag minio-hs:dev