-
Notifications
You must be signed in to change notification settings - Fork 22
78 lines (63 loc) · 2.12 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Building on all platforms
on:
workflow_dispatch: # can be triggered manually
push:
branches:
- main # run for the main branch
paths:
- conjure-cp.cabal
- Makefile
- src/**
- etc/build/**
- etc/hs-deps/**
- .github/workflows/build.yml
pull_request: # and for PRs
paths:
- conjure-cp.cabal
- Makefile
- src/**
- etc/build/**
- etc/hs-deps/**
- .github/workflows/build.yml
# other branches that want testing must create a PR
env:
SCCACHE_GHA_ENABLED: "true"
jobs:
Job:
strategy:
matrix:
GHC_VERSION: ["9.0", "9.2", "9.4"]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
name: Checkout repository
- name: Stack version
shell: bash
run: GHC_VERSION=${{ matrix.GHC_VERSION }} make stack.yaml
- uses: actions/cache@v4
name: Cache stack
with:
path: |
~/.stack
.stack-work
key: stack-${{ runner.os }}-ghc${{ matrix.GHC_VERSION }}-${{ github.event.repository.updated_at }}
restore-keys: stack-${{ runner.os }}-ghc${{ matrix.GHC_VERSION }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Setting PATH
shell: bash
run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- name: Install Conjure
shell: bash
run: BIN_DIR=${HOME}/.local/bin GHC_VERSION=${{ matrix.GHC_VERSION }} BUILD_TESTS=true make
- name: Install Minion
shell: bash
run: BIN_DIR=${HOME}/.local/bin etc/build/install-minion.sh
- name: Simple test
shell: bash
run: |
echo "find x : set of int(1..5) such that sum(x)=5" > test.essence
conjure solve test.essence --number-of-solutions=all --solutions-in-one-file --output-format=json
cat test.solutions.json
diff <(echo '[{"x":[5]},{"x":[2,3]},{"x":[1,4]}]' | tr -d '[:space:]') <(cat test.solutions.json | tr -d '[:space:]')