-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (82 loc) · 2.45 KB
/
main.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Testing
on:
push:
branches:
- develop
pull_request:
branches:
- develop
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Lint Check
timeout-minutes: 50
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: ⚡ Restore Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: 🔨 Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt, clippy
- name: 🔎 Run cargo linting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
test:
name: Test Suite
timeout-minutes: 120
runs-on: ubuntu-latest
environment:
name: develop
steps:
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v1
with:
remove-android: "true"
remove-haskell: "true"
- name: Fetch source code
uses: actions/checkout@v3
- name: Install nix
uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE= cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ=
substituters = https://cache.holo.host https://cache.nixos.org/
- name: Set up cachix
uses: cachix/cachix-action@v14
with:
name: holochain-ci
- name: Build Nix packages
run: nix develop -c $SHELL -c "echo Nix packages built"
- name: ⚡ Restore cache
uses: actions/cache/restore@v3
with:
path: |
.cargo
target
key: ${{ runner.os }}-build-happ-${{ hashFiles('Cargo.lock') }}
- name: 🔎 Run Cargo Tests
run: |
nix develop --command bash -c "cargo test -- --nocapture"
- name: Save build to cache
uses: actions/cache/save@v3
with:
path: |
.cargo
target
key: ${{ runner.os }}-build-happ-${{ hashFiles('Cargo.lock') }}