-
Notifications
You must be signed in to change notification settings - Fork 444
109 lines (93 loc) · 3.01 KB
/
ci-test-mac.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
97
98
99
100
101
102
103
104
105
106
107
108
109
name: "test-p4c-mac"
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
branches: [main]
# Cancel any preceding run on the pull request.
concurrency:
group: test-p4c-mac-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
# Build and test p4c on MacOS for M1 Macs.
test-mac-os-m1:
runs-on: macos-14
env:
CTEST_PARALLEL_LEVEL: 4
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-${{ runner.os }}
max-size: 1000M
- name: Get brew cache dir
id: brew-cache
run: |
echo "dir=$(brew --prefix)" >> $GITHUB_OUTPUT
- name: Cache Homebrew Packages
id: cache-homebrew-packages
uses: actions/cache@v4
env:
cache-name: homebrew-packages
with:
path: ${{ steps.brew-cache.outputs.dir }}
key: ${{ runner.os }}-m1-${{ hashFiles('tools/install_mac_deps.sh') }}
- name: Install dependencies (MacOS)
run: |
tools/install_mac_deps.sh
- name: Build (MacOS)
run: |
source ~/.bash_profile
./bootstrap.sh -DENABLE_GC=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_UNITY_BUILD=ON -DENABLE_TEST_TOOLS=ON -DENABLE_WERROR=ON --build-generator "Ninja"
cmake --build build -- -j $(nproc)
- name: Run tests (MacOS)
run: |
source ~/.bash_profile
ctest --output-on-failure --schedule-random -E "bpf|ubpf|testgen|smith"
working-directory: ./build
# Build and test p4c on MacOS 13 on x86.
test-mac-os:
runs-on: macos-13
env:
CTEST_PARALLEL_LEVEL: 4
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-${{ runner.os }}
max-size: 1000M
- name: Get brew cache dir
id: brew-cache
run: |
echo "dir=$(brew --prefix)" >> $GITHUB_OUTPUT
- name: Cache Homebrew Packages
id: cache-homebrew-packages
uses: actions/cache@v4
env:
cache-name: homebrew-packages
with:
path: ${{ steps.brew-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('tools/install_mac_deps.sh') }}
- name: Install dependencies (MacOS)
run: |
tools/install_mac_deps.sh
- name: Build (MacOS)
run: |
source ~/.bash_profile
./bootstrap.sh -DENABLE_GC=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_UNITY_BUILD=ON -DENABLE_TEST_TOOLS=ON -DENABLE_WERROR=ON --build-generator "Ninja"
cmake --build build -- -j $(nproc)
- name: Run tests (MacOS)
run: |
source ~/.bash_profile
ctest --output-on-failure --schedule-random -E "bpf|ubpf|testgen|smith"
working-directory: ./build