-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (135 loc) · 4.53 KB
/
build.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: build
on:
push:
branches:
- main
- main-0.4
- main-0.3
pull_request:
branches:
- main
- main-0.4
- main-0.3
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
nix-check:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.24.9/install
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: holochain-ci
- name: Check Nix formatting
run: nix fmt . -- --check
- name: Check Nix flake
run: nix flake check --all-systems
script-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azohra/shell-linter@latest
- name: Test bump-holochain.sh
run: |
MINOR_VERSION=$(./scripts/bump-holochain.sh main-0.1 false | tail -n 1)
if [[ "$MINOR_VERSION" != "holochain-0.1.8" ]]; then
echo "bump.sh failed to find 0.1.8: [${MINOR_VERSION}]"
exit 1
fi
RC_VERSION=$(./scripts/bump-holochain.sh main-0.1-rc false | tail -n 1)
if [[ "$RC_VERSION" != "holochain-0.1.7-rc.0" ]]; then
echo "bump.sh failed to find 0.1.7-rc.0: [${RC_VERSION}]"
exit 1
fi
# Print tag that would be used to update flake on main branch
CURRENT_VERSION=$(./scripts/bump-holochain.sh main false | tail -n 1)
if [[ "$CURRENT_VERSION" != holochain-0.5.*dev* ]]; then
echo "bump.sh failed to find current version: [${CURRENT_VERSION}]"
exit 1
fi
build:
needs: [nix-check, script-test]
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13]
packages:
- [holochain,hc,hc-run-local-services,hc-sandbox,hcterm]
- [lair-keystore]
- [hc-launch]
- [hc-scaffold]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Maximize build space (Linux)
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@v4
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Maximise build space (Mac OS)
if: runner.os == 'macOS'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Print platform information
run: uname -ms
- name: Check out source code
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.24.6/install
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: holochain-ci
- name: Run nix app
run: |
echo '${{ toJSON(matrix.packages) }}' | jq -r '.[]' | while read app; do nix run ".#$app" -- --version; done
template:
needs: build
strategy:
matrix:
templates:
- default
- custom
- rust-stable
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v4
with:
remove-dotnet: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.24.9/install
extra_nix_config: |
accept-flake-config = true
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Init from template
run: |
cd $(mktemp -d)
echo "Fetching template from branch ${{ steps.extract_branch.outputs.branch }}"
nix flake init -t "github:holochain/holonix?ref=${{ steps.extract_branch.outputs.branch }}#${{ matrix.template }}"
nix develop --override-input holonix "github:holochain/holonix?ref=${{ steps.extract_branch.outputs.branch }}" -c hn-introspect