forked from holochain/holochain
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.86 KB
/
holochain-build-and-test.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
name: "holochain build and test"
on:
workflow_call:
inputs:
repo_path:
description: "a path to the holochain repository"
required: false
type: string
default: "."
jobs:
"test":
strategy:
fail-fast: false
matrix:
cmd:
# ensure functionality on multiple platforms
- pkgs:
- build-holochain-tests-unit-all
- build-holonix-tests-integration
extra_arg: "--override-input versions ./versions/0_2 --override-input holochain ${{ inputs.repo_path }}"
# ensures to keep the cache populated for the supported versions on multiple platforms
- pkgs:
- build-holonix-tests-integration
extra_arg: "--override-input versions ./versions/0_2"
- pkgs:
- build-holonix-tests-integration
extra_arg: "--override-input versions ./versions/0_1"
platform:
- system: x86_64-darwin
- system: aarch64-darwin
- system: x86_64-linux
include:
# we only run repo consistency checks on x86_64-linux
- cmd:
pkgs:
- build-holochain-build-crates-standalone
- build-release-automation-tests
- build-release-automation-tests-repo
- build-holochain-tests-static-all
extra_arg: "--override-input versions ./versions/0_2 --override-input holochain ${{ inputs.repo_path }}"
platform:
system: x86_64-linux
# runs-on: ${{ matrix.platform.runs-on }}
runs-on: [self-hosted, multi-arch]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
lfs: false
- name: Print matrix
env:
MATRIX: ${{ toJSON(matrix) }}
run: echo ${MATRIX}
- name: "Test command ${{ matrix.nixCommand }}"
env:
system: ${{ matrix.platform.system }}
NIX_CONFIG: "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}"
run: |
set -xe
# if a nix store path was passed, ensure it exists locally
if [[ ${{ inputs.repo_path }} == "/nix/"* ]]; then
nix-store --realise ${{inputs.repo_path }}
fi
# first build all derivations. this could be enough for test derivations.
nix build -L --show-trace \
${{ matrix.cmd.extra_arg }} \
.#packages.${system}.${{ join(matrix.cmd.pkgs, ' .#packages.${system}.')}}
# TODO: remove this once we've implemented all tests and know that we don't need it
# if there's something to run we generate separate commands
# if [[ ${{ matrix.cmd.verb }} == "run" ]]; then
# export basecmd="nix run -L --show-trace .#packages.${system}."
# ${basecmd}${{ join(matrix.cmd.pkgs, '; ${basecmd}') }}
# fi