git.iko.soy/typeable/minio-hs
on master help sign in
Use single CI file based on kowainik (#162)

* Use single CI file based on kowainik

commitc52f2811fe8eb2a657f1467d0798067a15deb395 authorAditya Manthramurthy <donatello@users.noreply.github.com> dateMon 22 Mar 2021, 09:36 (6 years ago) parentaa2382b
4 files changed+185−291
.github/workflows/ci.yml+185 .github/workflows/haskell-cabal.yml−122 .github/workflows/haskell-stack.yml−108 .travis.yml−61
.github/workflows/ci.ymlnew file+185
@@ -0,0 +1,185 @@
1+name: CI
2+
3+# Trigger the workflow on push or pull request, but only for the main branch
4+on:
5+ pull_request:
6+ push:
7+ branches: [master]
8+
9+# Env vars for tests
10+env:
11+ MINIO_ACCESS_KEY: minio
12+ MINIO_SECRET_KEY: minio123
13+ MINIO_LOCAL: 1
14+ MINIO_SECURE: 1
15+
16+jobs:
17+ cabal:
18+ name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
19+ runs-on: ${{ matrix.os }}
20+ strategy:
21+ matrix:
22+ os: [ubuntu-latest, macOS-latest, windows-latest]
23+ cabal: ["3.2"]
24+ ghc:
25+ - "8.4.4"
26+ - "8.6.5"
27+ - "8.8.4"
28+ - "8.10.2"
29+ exclude:
30+ - os: macOS-latest
31+ ghc: 8.8.4
32+ - os: macOS-latest
33+ ghc: 8.6.5
34+ - os: windows-latest
35+ ghc: 8.10.2
36+ - os: windows-latest
37+ ghc: 8.6.5
38+
39+ steps:
40+ - uses: actions/checkout@v2
41+ if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
42+
43+ - uses: actions/setup-haskell@v1.1.4
44+ id: setup-haskell-cabal
45+ name: Setup Haskell
46+ with:
47+ ghc-version: ${{ matrix.ghc }}
48+ cabal-version: ${{ matrix.cabal }}
49+
50+ - name: Configure
51+ run: |
52+ cabal configure --enable-tests --enable-benchmarks --test-show-details=direct -fexamples -flive-test
53+
54+ - name: Freeze
55+ run: |
56+ cabal freeze
57+
58+ - uses: actions/cache@v2.1.3
59+ name: Cache ~/.cabal/store
60+ with:
61+ path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
62+ key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
63+
64+ - name: Install dependencies
65+ run: |
66+ cabal build all --only-dependencies -fexamples -flive-test
67+
68+ - name: Build
69+ run: |
70+ cabal build all -fexamples
71+
72+ - name: Setup MinIO for testing (Linux)
73+ if: matrix.os == 'ubuntu-latest'
74+ run: |
75+ mkdir -p /tmp/minio /tmp/minio-config/certs
76+ cp test/cert/* /tmp/minio-config/certs/
77+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
78+ sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
79+ sudo update-ca-certificates
80+
81+ - name: Setup MinIO for testing (MacOS)
82+ if: matrix.os == 'macos-latest'
83+ run: |
84+ mkdir -p /tmp/minio /tmp/minio-config/certs
85+ cp test/cert/* /tmp/minio-config/certs/
86+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
87+ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
88+
89+ - name: Setup MinIO for testing (Windows)
90+ if: matrix.os == 'windows-latest'
91+ run: |
92+ New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
93+ Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
94+ Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
95+ Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
96+
97+ - name: Test (Non-Windows)
98+ if: matrix.os != 'windows-latest'
99+ run: |
100+ /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
101+ ghc --version
102+ cabal --version
103+ cabal test all -flive-test
104+
105+ - name: Test (Windows)
106+ if: matrix.os == 'windows-latest'
107+ run: |
108+ 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"
109+ ghc --version
110+ cabal --version
111+ cabal test all -flive-test
112+
113+ stack:
114+ name: stack / ghc ${{ matrix.ghc }}
115+ runs-on: ${{ matrix.os }}
116+ strategy:
117+ matrix:
118+ stack: ["2.3.1"]
119+ ghc: ["8.8.4"]
120+ os: [ubuntu-latest]
121+
122+ steps:
123+ - uses: actions/checkout@v2
124+ if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
125+
126+ - uses: actions/setup-haskell@v1.1.4
127+ name: Setup Haskell Stack
128+ with:
129+ ghc-version: ${{ matrix.ghc }}
130+ stack-version: ${{ matrix.stack }}
131+
132+ - uses: actions/cache@v2.1.3
133+ name: Cache ~/.stack
134+ with:
135+ path: ~/.stack
136+ key: ${{ runner.os }}-${{ matrix.ghc }}-stack
137+
138+ - name: Install dependencies
139+ run: |
140+ stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
141+
142+ - name: Build
143+ run: |
144+ stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples
145+
146+ - name: Setup MinIO for testing (Linux)
147+ if: matrix.os == 'ubuntu-latest'
148+ run: |
149+ mkdir -p /tmp/minio /tmp/minio-config/certs
150+ cp test/cert/* /tmp/minio-config/certs/
151+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
152+ sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
153+ sudo update-ca-certificates
154+
155+ - name: Setup MinIO for testing (MacOS)
156+ if: matrix.os == 'macos-latest'
157+ run: |
158+ mkdir -p /tmp/minio /tmp/minio-config/certs
159+ cp test/cert/* /tmp/minio-config/certs/
160+ (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
161+ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
162+
163+ - name: Setup MinIO for testing (Windows)
164+ if: matrix.os == 'windows-latest'
165+ run: |
166+ New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
167+ Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
168+ Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
169+ Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
170+
171+ - name: Test (Non-Windows)
172+ if: matrix.os != 'windows-latest'
173+ run: |
174+ /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
175+ ghc --version
176+ stack --version
177+ stack test --system-ghc --flag minio-hs:live-test
178+
179+ - name: Test (Windows)
180+ if: matrix.os == 'windows-latest'
181+ run: |
182+ 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"
183+ ghc --version
184+ cabal --version
185+ stack test --system-ghc --flag minio-hs:live-test
.github/workflows/haskell-cabal.ymldeleted−122
@@ -1,122 +0,0 @@
1−name: Haskell CI (Cabal)
2−
3−on:
4− schedule:
5− # Run every weekday
6− - cron: '0 0 * * 1-5'
7− push:
8− branches: [ master ]
9− pull_request:
10− branches: [ master ]
11−
12−jobs:
13− cabal-build:
14−
15− runs-on: ${{ matrix.os }}
16− strategy:
17− fail-fast: false
18− matrix:
19− ghc: ['8.4', '8.6', '8.8', '8.10']
20− cabal: ['3.2']
21− os: [ubuntu-latest, macOS-latest]
22− experimental: [false]
23− include:
24− - ghc: '8.6'
25− cabal: '3.2'
26− os: windows-latest
27− experimental: false
28− - ghc: '8.10'
29− cabal: '3.2'
30− os: windows-latest
31− experimental: false
32−
33− # Appears to be buggy to build in windows with ghc 8.4 and 8.8
34− - ghc: '8.4'
35− cabal: '3.2'
36− os: windows-latest
37− experimental: true
38− - ghc: '8.8'
39− cabal: '3.2'
40− os: windows-latest
41− experimental: true
42−
43− steps:
44− - uses: actions/checkout@v2
45− - uses: haskell/actions/setup@v1
46− with:
47− ghc-version: ${{ matrix.ghc }}
48− cabal-version: ${{ matrix.cabal }}
49−
50− - name: Cache
51− uses: actions/cache@v2
52− env:
53− cache-name: cabal-cache-${{ matrix.ghc }}-${{ matrix.cabal }}
54− with:
55− path: |
56− ~/.cabal
57− ~/.stack
58− %appdata%\cabal
59− %LOCALAPPDATA%\Programs\stack
60− key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
61− restore-keys: |
62− ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
63− ${{ runner.os }}-build-${{ env.cache-name }}-
64− ${{ runner.os }}-build-
65− ${{ runner.os }}-
66−
67− - name: Before install (Linux)
68− if: matrix.os == 'ubuntu-latest'
69− run: |
70− mkdir -p /tmp/minio /tmp/minio-config/certs
71− cp test/cert/* /tmp/minio-config/certs/
72− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
73− sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
74− sudo update-ca-certificates
75−
76− - name: Before install (MacOS)
77− if: matrix.os == 'macos-latest'
78− run: |
79− mkdir -p /tmp/minio /tmp/minio-config/certs
80− cp test/cert/* /tmp/minio-config/certs/
81− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
82− sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
83−
84− - name: Before install (Windows)
85− if: matrix.os == 'windows-latest'
86− run: |
87− New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
88− Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
89− Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
90− Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
91−
92− - name: Install dependencies, build and test (Non-Windows)
93− if: matrix.os != 'windows-latest'
94− env:
95− MINIO_ACCESS_KEY: minio
96− MINIO_SECRET_KEY: minio123
97− MINIO_LOCAL: 1
98− MINIO_SECURE: 1
99− continue-on-error: ${{ matrix.experimental }}
100− run: |
101− /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
102− ghc --version
103− cabal --version
104− cabal new-update
105− cabal new-build --enable-tests --enable-benchmarks -fexamples
106− cabal new-test --enable-tests -flive-test
107−
108− - name: Install dependencies, build and test (Windows)
109− if: matrix.os == 'windows-latest'
110− env:
111− MINIO_ACCESS_KEY: minio
112− MINIO_SECRET_KEY: minio123
113− MINIO_LOCAL: 1
114− MINIO_SECURE: 1
115− continue-on-error: ${{ matrix.experimental }}
116− run: |
117− 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"
118− ghc --version
119− cabal --version
120− cabal new-update
121− cabal new-build --enable-tests --enable-benchmarks -fexamples
122− cabal new-test --enable-tests -flive-test
.github/workflows/haskell-stack.ymldeleted−108
@@ -1,108 +0,0 @@
1−name: Haskell CI (Stack)
2−
3−on:
4− schedule:
5− # Run every weekday
6− - cron: '0 0 * * 1-5'
7− push:
8− branches: [ master ]
9− pull_request:
10− branches: [ master ]
11−
12−jobs:
13− stack-build:
14−
15− runs-on: ${{ matrix.os }}
16− strategy:
17− fail-fast: false
18− matrix:
19− ghc: ['8.8']
20− cabal: ['3.2']
21− os: [ubuntu-latest, macOS-latest]
22− experimental: [false]
23− include:
24− # Appears to be buggy to build in windows with ghc 8.8
25− - ghc: '8.8'
26− cabal: '3.2'
27− os: windows-latest
28− experimental: true
29−
30− steps:
31− - uses: actions/checkout@v2
32− - uses: haskell/actions/setup@v1
33− with:
34− ghc-version: ${{ matrix.ghc }}
35− cabal-version: ${{ matrix.cabal }}
36− enable-stack: true
37−
38− - name: Cache
39− uses: actions/cache@v2
40− env:
41− cache-name: stack-cache-${{ matrix.ghc }}-${{ matrix.cabal }}
42− with:
43− path: |
44− ~/.cabal
45− ~/.stack
46− %appdata%\cabal
47− %LOCALAPPDATA%\Programs\stack
48− key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
49− restore-keys: |
50− ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
51− ${{ runner.os }}-build-${{ env.cache-name }}-
52− ${{ runner.os }}-build-
53− ${{ runner.os }}-
54−
55− - name: Before install (Linux)
56− if: matrix.os == 'ubuntu-latest'
57− run: |
58− mkdir -p /tmp/minio /tmp/minio-config/certs
59− cp test/cert/* /tmp/minio-config/certs/
60− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
61− sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
62− sudo update-ca-certificates
63−
64− - name: Before install (MacOS)
65− if: matrix.os == 'macos-latest'
66− run: |
67− mkdir -p /tmp/minio /tmp/minio-config/certs
68− cp test/cert/* /tmp/minio-config/certs/
69− (cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
70− sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
71−
72− - name: Before install (Windows)
73− if: matrix.os == 'windows-latest'
74− run: |
75− New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
76− Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
77− Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
78− Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
79−
80− - name: Install dependencies, build and test (Non-Windows)
81− if: matrix.os != 'windows-latest'
82− env:
83− MINIO_ACCESS_KEY: minio
84− MINIO_SECRET_KEY: minio123
85− MINIO_LOCAL: 1
86− MINIO_SECURE: 1
87− continue-on-error: ${{ matrix.experimental }}
88− run: |
89− /tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
90− ghc --version
91− stack --version
92− stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples
93− stack test --system-ghc --flag minio-hs:live-test
94−
95− - name: Install dependencies, build and test (Windows)
96− if: matrix.os == 'windows-latest'
97− env:
98− MINIO_ACCESS_KEY: minio
99− MINIO_SECRET_KEY: minio123
100− MINIO_LOCAL: 1
101− MINIO_SECURE: 1
102− continue-on-error: ${{ matrix.experimental }}
103− run: |
104− 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"
105− ghc --version
106− stack --version
107− stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples
108− stack test --system-ghc --flag minio-hs:live-test
.travis.ymldeleted−61
@@ -1,61 +0,0 @@
1−sudo: true
2−language: haskell
3−
4−git:
5− depth: 5
6−
7−cabal: "3.0"
8−
9−cache:
10− directories:
11− - "$HOME/.cabal/store"
12− - "$HOME/.stack"
13− - "$TRAVIS_BUILD_DIR/.stack-work"
14−
15−matrix:
16− include:
17−
18− # Cabal
19− - ghc: 8.4.4
20− - ghc: 8.6.5
21− - ghc: 8.8.3
22−
23− # Stack
24− - ghc: 8.6.5
25− env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"
26−
27−before_install:
28− - sudo apt-get install devscripts
29− - mkdir /tmp/minio /tmp/certs
30− - (cd /tmp/minio; wget https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
31− - (cd /tmp/certs; openssl req -newkey rsa:2048 -nodes -keyout private.key -x509 -days 36500 -out public.crt -subj "/C=US/ST=NRW/L=Earth/O=CompanyName/OU=IT/CN=localhost/emailAddress=email@example.com")
32− - sudo cp /tmp/certs/public.crt /usr/local/share/ca-certificates/
33− - sudo update-ca-certificates
34− - MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=minio123 /tmp/minio/minio server --quiet --certs-dir /tmp/certs data 2>&1 > minio.log &
35−
36−install:
37− - |
38− if [ -z "$STACK_YAML" ]; then
39− ghc --version
40− cabal --version
41− cabal new-update
42− cabal new-build --enable-tests --enable-benchmarks -fexamples
43− else
44− # install stack
45− curl -sSL https://get.haskellstack.org/ | sh
46−
47− # build project with stack
48− stack --version
49− stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples
50− fi
51−
52−script:
53− - |
54− if [ -z "$STACK_YAML" ]; then
55− MINIO_LOCAL=1 MINIO_SECURE=1 cabal new-test --enable-tests -flive-test
56− else
57− MINIO_LOCAL=1 MINIO_SECURE=1 stack test --system-ghc --flag minio-hs:live-test
58− fi
59−
60−notifications:
61− email: false