|
1 | 1 | name: "Test"
|
2 | 2 | on:
|
3 | 3 | pull_request:
|
4 |
| - push: |
5 | 4 | jobs:
|
6 |
| - test-nix: |
| 5 | + nix: |
| 6 | + name: 'Nix' |
7 | 7 | runs-on: ubuntu-latest
|
8 | 8 | steps:
|
9 |
| - - uses: actions/checkout@v2.3.4 |
10 |
| - with: |
11 |
| - submodules: recursive |
12 |
| - - uses: cachix/install-nix-action@v12 |
13 |
| - - uses: cachix/cachix-action@v8 |
14 |
| - with: |
15 |
| - name: runtimeverification |
16 |
| - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' |
17 |
| - - run: nix-build -A kore -A project.kore.checks |
18 |
| - - run: nix-shell --run "echo OK" |
19 |
| - |
20 |
| - test-cabal: |
| 9 | + - name: Check out code |
| 10 | + uses: actions/checkout@v2.3.4 |
| 11 | + with: |
| 12 | + submodules: recursive |
| 13 | + # Avoid cloning a detached-HEAD repository on pull_request events. |
| 14 | + # git-auto-commit-action (below) needs this to find the original |
| 15 | + # branch where it should push the changes. |
| 16 | + ref: ${{ github.head_ref }} |
| 17 | + |
| 18 | + - name: Install Nix |
| 19 | + uses: cachix/install-nix-action@v12 |
| 20 | + with: |
| 21 | + extra_nix_config: | |
| 22 | + substituters = http://cache.nixos.org https://hydra.iohk.io |
| 23 | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= |
| 24 | +
|
| 25 | + - name: Install Cachix |
| 26 | + uses: cachix/cachix-action@v8 |
| 27 | + with: |
| 28 | + name: kore |
| 29 | + signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}' |
| 30 | + |
| 31 | + - name: Materialize |
| 32 | + run: ./nix/rematerialize.sh |
| 33 | + |
| 34 | + - name: Commit changes |
| 35 | + uses: stefanzweifel/git-auto-commit-action@v4.7.2 |
| 36 | + with: |
| 37 | + commit_message: 'Materialize Nix expressions' |
| 38 | + file_pattern: 'nix/' |
| 39 | + |
| 40 | + - name: Build |
| 41 | + run: nix-build -A kore |
| 42 | + |
| 43 | + - name: Run unit tests |
| 44 | + run: nix-build -A project.kore.checks |
| 45 | + |
| 46 | + - name: Check shell |
| 47 | + run: nix-shell --run "echo OK" |
| 48 | + |
| 49 | + cabal: |
| 50 | + name: 'Cabal' |
21 | 51 | runs-on: ubuntu-latest
|
22 | 52 | steps:
|
23 |
| - - uses: actions/checkout@v2.3.4 |
24 |
| - with: |
25 |
| - submodules: recursive |
26 |
| - |
27 |
| - - uses: actions/setup-haskell@v1.1.4 |
28 |
| - id: setup-haskell-cabal |
29 |
| - with: |
30 |
| - ghc-version: "8.10.1" |
31 |
| - cabal-version: "3.2" |
32 |
| - |
33 |
| - - name: Cache Cabal store |
34 |
| - uses: actions/cache@v2 |
35 |
| - with: |
36 |
| - path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
37 |
| - key: ${{ runner.os }}-ghc-8.10.1-${{ hashFiles('cabal.project.freeze') }} |
38 |
| - |
39 |
| - - name: Build project |
40 |
| - run: cabal v2-build --enable-tests --enable-benchmarks all |
41 |
| - |
42 |
| - - name: Configure with profiling |
43 |
| - run: cabal v2-configure --enable-profiling -f-threaded |
| 53 | + - name: Install prerequisites |
| 54 | + run: | |
| 55 | + sudo apt install --yes z3 |
| 56 | +
|
| 57 | + - uses: actions/checkout@v2.3.4 |
| 58 | + with: |
| 59 | + submodules: recursive |
| 60 | + |
| 61 | + - uses: actions/setup-haskell@v1.1.4 |
| 62 | + id: setup-haskell-cabal |
| 63 | + with: |
| 64 | + ghc-version: "8.10.1" |
| 65 | + cabal-version: "3.2" |
| 66 | + |
| 67 | + - name: Cache Cabal store |
| 68 | + uses: actions/cache@v2 |
| 69 | + with: |
| 70 | + path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
| 71 | + key: ${{ runner.os }}-ghc-8.10.1-${{ hashFiles('cabal.project.freeze') }} |
| 72 | + |
| 73 | + - name: Build |
| 74 | + run: cabal v2-build --enable-tests --enable-benchmarks all |
| 75 | + |
| 76 | + - name: Run unit tests |
| 77 | + run: cabal v2-test --test-show-details=direct all |
| 78 | + |
| 79 | + - name: Configure with profiling |
| 80 | + run: cabal v2-configure --enable-profiling -f-threaded |
| 81 | + |
| 82 | + stack: |
| 83 | + name: 'Stack' |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Install prerequisites |
| 87 | + run: | |
| 88 | + sudo apt install --yes z3 |
| 89 | +
|
| 90 | + - uses: actions/checkout@v2.3.4 |
| 91 | + with: |
| 92 | + submodules: recursive |
| 93 | + |
| 94 | + - uses: actions/setup-haskell@v1.1.4 |
| 95 | + id: setup-haskell-stack |
| 96 | + with: |
| 97 | + enable-stack: true |
| 98 | + stack-no-global: true |
| 99 | + stack-setup-ghc: true |
| 100 | + |
| 101 | + - name: Locate Stack root |
| 102 | + id: locate-stack-root |
| 103 | + run: | |
| 104 | + echo "::set-output name=stack-root::$(stack path --stack-root)" |
| 105 | +
|
| 106 | + - name: Cache Stack root |
| 107 | + uses: actions/cache@v2 |
| 108 | + with: |
| 109 | + path: ${{ steps.locate-stack-root.outputs.stack-root }} |
| 110 | + key: ${{ runner.os }}-ghc-8.10.1-${{ hashFiles('stack.yaml.lock') }} |
| 111 | + |
| 112 | + - name: Build project |
| 113 | + run: stack build --pedantic |
| 114 | + |
| 115 | + - name: Run unit tests |
| 116 | + run: stack test --pedantic |
0 commit comments