Skip to content

Commit e016198

Browse files
committed
test
1 parent 9564a3d commit e016198

File tree

1 file changed

+7
-158
lines changed

1 file changed

+7
-158
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -17,73 +17,30 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- ghc: '9.10.2'
21-
os: ubuntu-latest
22-
stack_yaml: 'stack-ghc-9.10.yaml'
23-
stack_args: ''
24-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018'
25-
platform: linux-x86_64
26-
# Use GHC 9.10 on windows to avoid the issue with foreign-library
27-
# https://github.com/haskell/cabal/issues/9982
28-
- ghc: '9.10.2'
29-
os: windows-latest
30-
stack_yaml: 'stack-ghc-9.10.yaml'
31-
stack_args: ''
32-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018'
33-
platform: win64
34-
release: true
35-
3620
- ghc: '9.8.4'
3721
os: ubuntu-latest
3822
stack_yaml: 'stack-ghc-9.8.yaml'
3923
stack_args: '--haddock --no-haddock-deps'
4024
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018'
4125
platform: linux-x86_64
4226
release: true
27+
4328
- ghc: '9.8.4'
4429
os: ubuntu-latest
4530
stack_yaml: 'stack-ghc-9.8.yaml'
4631
stack_args: '--docker --docker-image "quay.io/benz0li/ghc-musl:9.8.4"'
4732
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018 --flag toysolver:LinuxStatic'
4833
platform: linux-x86_64-static
4934
release: true
35+
5036
- ghc: '9.8.4'
51-
os: macos-latest
52-
stack_yaml: 'stack-ghc-9.8.yaml'
53-
stack_args: ''
54-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018'
55-
platform: macos-aarch64
56-
release: true
57-
- ghc: '9.8.4'
58-
os: macos-latest
37+
os: ubuntu-latest
5938
stack_yaml: 'stack-ghc-9.8.yaml'
60-
stack_args: ''
61-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018'
62-
platform: macos-x86_64
39+
stack_args: '--docker --docker-image "quay.io/benz0li/ghc-musl:9.8.4"'
40+
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018
41+
platform: linux-x86_64-static
6342
release: true
6443
65-
- ghc: '9.6.7'
66-
os: ubuntu-latest
67-
stack_yaml: 'stack-ghc-9.6.yaml'
68-
stack_args: ''
69-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms --flag toysolver:optparse-applicative-018'
70-
platform: linux-x86_64
71-
72-
- ghc: '9.4.8'
73-
os: ubuntu-latest
74-
stack_yaml: 'stack-ghc-9.4.yaml'
75-
stack_args: '--coverage'
76-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms'
77-
platform: linux-x86_64
78-
coveralls: true
79-
80-
- ghc: '9.2.8'
81-
os: ubuntu-latest
82-
stack_yaml: 'stack-ghc-9.2.yaml'
83-
stack_args: ''
84-
flags: '--flag toysolver:BuildToyFMF --flag toysolver:BuildSamplePrograms --flag toysolver:BuildMiscPrograms'
85-
platform: linux-x86_64
86-
8744
steps:
8845
- uses: actions/checkout@v4
8946
with:
@@ -101,7 +58,7 @@ jobs:
10158
ghc-version: ${{ matrix.ghc }}
10259
enable-stack: true
10360
stack-version: 'latest'
104-
stack-no-global: ${{ (matrix.platform == 'macos-x86_64') && 'true' || '' }}
61+
stack-no-global: ${{ (matrix.platform == 'linux-x86_64-static') && 'true' || '' }}
10562
cabal-update: false
10663

10764
- name: Setup stack to use system GHC
@@ -136,111 +93,3 @@ jobs:
13693
- name: Build
13794
shell: bash
13895
run: stack build --test --no-run-tests --bench --no-run-benchmarks --ghc-options=-j ${{ matrix.stack_args }} ${{ matrix.flags }}
139-
140-
- name: Test
141-
shell: bash
142-
# -j1 is for https://github.com/commercialhaskell/stack/issues/5024
143-
run: stack test ${{ matrix.stack_args }} -j1 ${{ matrix.flags }}
144-
timeout-minutes: 10
145-
146-
- name: Check IPASIR DLL dependencies
147-
if: ${{ !endsWith(matrix.platform, '-static') }}
148-
continue-on-error: true
149-
shell: bash
150-
run: |
151-
if [[ ${{ runner.os }} = "macOS" ]]; then
152-
otool -L `stack path --local-install-root ${{ matrix.stack_args }}`/lib/libtoysat-ipasir.dylib
153-
elif [[ ${{ runner.os }} = "Windows" ]]; then
154-
ldd `stack path --local-install-root ${{ matrix.stack_args }}`/lib/toysat-ipasir.dll
155-
else
156-
ldd `stack path --local-install-root ${{ matrix.stack_args }}`/lib/libtoysat-ipasir.so
157-
fi
158-
159-
- name: Test IPASIR DLL using genipaessentials
160-
if: ${{ !endsWith(matrix.platform, '-static') }}
161-
shell: bash
162-
run: |
163-
if [[ ${{ matrix.platform }} = "macos-x86_64" ]]; then
164-
stack exec ${{ matrix.stack_args }} -- arch -x86_64 g++ -Wall -Iapp/toysat-ipasir/ misc/genipaessentials/genipaessentials.cpp -L`stack path --local-install-root ${{ matrix.stack_args }}`/lib -ltoysat-ipasir -o genipaessentials
165-
else
166-
stack exec ${{ matrix.stack_args }} -- g++ -Wall -Iapp/toysat-ipasir/ misc/genipaessentials/genipaessentials.cpp -L`stack path --local-install-root ${{ matrix.stack_args }}`/lib -ltoysat-ipasir -o genipaessentials
167-
fi
168-
if [[ ${{ runner.os }} = "macOS" ]]; then
169-
install_name_tool -add_rpath `stack path --local-install-root ${{ matrix.stack_args }}`/lib genipaessentials
170-
elif [[ ${{ runner.os }} = "Windows" ]]; then
171-
export PATH=$(cygpath -u $(stack path --local-install-root ${{ matrix.stack_args }}))/lib:$PATH
172-
else
173-
export LD_LIBRARY_PATH=`stack path --local-install-root ${{ matrix.stack_args }}`/lib:$LD_LIBRARY_PATH
174-
fi
175-
# "stack exec --" is necessary on windows-i386 for adding path of libstdc++
176-
stack exec ${{ matrix.stack_args }} -- ./genipaessentials misc/genipaessentials/inputs/sat100.cnf
177-
178-
- name: Coveralls
179-
if: matrix.coveralls
180-
continue-on-error: true
181-
env:
182-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
183-
run: |
184-
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar -xj
185-
./shc --repo-token="$COVERALLS_REPO_TOKEN" toysolver TestSuite TestPolynomial
186-
187-
- name: Test scripts
188-
shell: bash
189-
run: stack runhaskell ${{ matrix.stack_args }} misc/generate_packageVersions.hs > /dev/null
190-
191-
- name: Build artifacts
192-
id: build-artifact
193-
shell: bash
194-
run: |
195-
local_install_root=$(stack path --local-install-root ${{ matrix.stack_args }})
196-
stack runhaskell --package turtle -- misc/build_artifacts.hs --local-install-root "${local_install_root}" --platform ${{ matrix.platform }}
197-
198-
- name: Upload artifacts
199-
uses: actions/upload-artifact@v4
200-
if: matrix.release
201-
with:
202-
name: binary-packages-${{ matrix.platform }}
203-
path: |
204-
*.tar.xz
205-
*.7z
206-
retention-days: 2
207-
208-
github-release:
209-
name: github-release
210-
runs-on: ubuntu-latest
211-
if: startsWith(github.ref, 'refs/tags')
212-
needs: build
213-
steps:
214-
- uses: actions/checkout@v4
215-
with:
216-
submodules: true
217-
218-
- uses: actions/download-artifact@v4
219-
with:
220-
name: binary-packages-linux-x86_64
221-
path: binary-packages
222-
- uses: actions/download-artifact@v4
223-
with:
224-
name: binary-packages-linux-x86_64-static
225-
path: binary-packages
226-
- uses: actions/download-artifact@v4
227-
with:
228-
name: binary-packages-macos-aarch64
229-
path: binary-packages
230-
- uses: actions/download-artifact@v4
231-
with:
232-
name: binary-packages-macos-x86_64
233-
path: binary-packages
234-
- uses: actions/download-artifact@v4
235-
with:
236-
name: binary-packages-win64
237-
path: binary-packages
238-
239-
- name: Upload artifacts to GitHub Release
240-
shell: bash
241-
env:
242-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
243-
run: |
244-
shopt -s nullglob
245-
tag_name="${GITHUB_REF#refs/tags/}"
246-
gh release create --draft --title "${tag_name}" "${tag_name}" binary-packages/*

0 commit comments

Comments
 (0)