-
Notifications
You must be signed in to change notification settings - Fork 6
101 lines (90 loc) · 2.96 KB
/
ci.yaml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build and test
# Builds dependencies
# Builds and tests concordium client
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/ci.yaml'
- '**.hs'
- 'stack*.yaml'
- 'package.yaml'
- 'concordium-client.cabal'
- 'deps/concordium-base'
- 'deps/grpc-api'
- 'fourmolu.yaml'
push:
branches:
- main
paths:
- '.github/workflows/ci.yaml'
- '**.hs'
- 'stack*.yaml'
- 'package.yaml'
- 'concordium-client.cabal'
- 'deps/concordium-base'
- 'deps/grpc-api'
- 'fourmolu.yaml'
workflow_dispatch: # allow manual trigger
env:
RUST: 1.73
GHC: 9.6.4
jobs:
fourmolu:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Download fourmolu
uses: supplypike/setup-bin@v1
with:
uri: 'https://github.com/fourmolu/fourmolu/releases/download/v0.13.1.0/fourmolu-0.13.1.0-linux-x86_64'
name: 'fourmolu'
version: '0.13.1.0'
- name: Checkout project
uses: actions/checkout@v2
- name: Run fourmolu
run: |
fourmolu --color always --mode check $(git ls-files '*.hs')
concordium-client-build-and-test:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST }}
override: true
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ env.GHC }}
enable-stack: true
stack-no-global: true
- name: Install protoc
run: |
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.3/protoc-3.15.3-linux-x86_64.zip
unzip protoc-3.15.3-linux-x86_64.zip
sudo mv ./bin/protoc /usr/bin/protoc
- name: Cache cargo and stack dependencies and targets
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.stack
.stack-work
deps/concordium-base/.stack-work/
deps/concordium-base/lib/
deps/concordium-base/rust-src/target/release/
# Cache based on dependency versions, as well as the contents of the rust dependencies.
# This is a bit hacky, but we do not currently version the packages religously, so we need to do something like this.
key: ${{ runner.os }}-rust-stack-deps-${{ env.RUST }}-${{ hashFiles('stack.yaml', 'package.yaml', 'deps/concordium-base/haskell-src/**.hs', 'deps/concordium-base/rust-src/Cargo.toml', 'deps/concordium-base/rust-src/**.rs') }}
- name: Stack build # build all the binaries and tests, but don't run the tests
run: stack build --test --no-run-tests --ghc-options "-Werror"
- name: Stack test # run the tests
run: stack build --test