-
Notifications
You must be signed in to change notification settings - Fork 16
83 lines (79 loc) · 2.87 KB
/
build-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: "Build and test"
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
name: Format and License Checks
runs-on: ubuntu-20.04
container: ghcr.io/microsoft/ccf/app/dev/virtual:ccf-5.0.0
steps:
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout repository
uses: actions/checkout@v4
- run: ./scripts/ci-checks.sh
build-test:
name: CI
needs: checks
strategy:
matrix:
platform:
- name: virtual
image: virtual
nodes: ubuntu-20.04
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
unit_tests_enabled: ON
- name: sgx
image: sgx
nodes: [self-hosted, 1ES.Pool=gha-sgx-scitt-pool]
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision
unit_tests_enabled: OFF
runs-on: ${{ matrix.platform.nodes }}
container:
image: ghcr.io/microsoft/ccf/app/dev/${{ matrix.platform.image }}:ccf-5.0.0
options: ${{ matrix.platform.options }}
env:
# Helps to distinguish between CI and local builds.
SCITT_CI: 1
# Additional CMake flags.
PLATFORM: ${{ matrix.platform.name }}
CMAKE_BUILD_TYPE: Debug
ENABLE_PREFIX_TREE: OFF
ENABLE_CLANG_TIDY: ON
BUILD_TESTS: ${{ matrix.platform.unit_tests_enabled }}
# These make CI print all the errors, rather than stopping early.
CXXFLAGS: -ferror-limit=0
NINJA_FLAGS: -k 0
steps:
- name: Checkout repository with tags
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Platform SGX"
run: |
sudo groupadd -fg $(/usr/bin/stat -Lc '%g' /dev/sgx_provision) sgx_prv;
sudo usermod -a -G sgx_prv $(whoami);
cat /proc/cpuinfo | grep flags | uniq;
shell: bash
if: "${{ matrix.platform.name == 'sgx' }}"
# Work-around for https://github.com/actions/runner/issues/2033
- name: Work around git safe.directory in container
run: chown -R $(id -u):$(id -g) $PWD
- run: apt-get update && apt-get install -y libcurl4-openssl-dev faketime clang-tidy-10
- run: ./build.sh
- run: ./run_unit_tests.sh
if: "${{ matrix.platform.name != 'sgx' }}"
- run: ./run_functional_tests.sh --enable-faketime
- name: "Upload logs for ${{ matrix.platform.name }}"
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: logs-${{ matrix.platform.name }}
path: |
out
if-no-files-found: ignore