-
Notifications
You must be signed in to change notification settings - Fork 161
178 lines (177 loc) · 6.94 KB
/
oss-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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Buck build and test
on: [push, pull_request, workflow_dispatch]
jobs:
get-toolchains-to-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: facebook/install-dotslash@latest
- name: get_buck_graph
run: |
BUCK_GRAPH=$(./buck2 cquery //fizz/... --output-attribute '^buck.type$|^name$')
echo "$BUCK_GRAPH" > buck_graph_results.json
shell: bash
- name: Check if rust_binary
id: check_rust
run: |
OUTPUT=$(cat buck_graph_results.json)
if [[ "$OUTPUT" == *"rust_binary"* ]]; then
echo "uses_rust=true" >> $GITHUB_ENV
fi
shell: bash
- name: Check if cxx_binary
id: check_cxx
run: |
OUTPUT=$(cat buck_graph_results.json)
if [[ "$OUTPUT" == *"cxx_binary"* ]]; then
echo "uses_cxx=true" >> $GITHUB_ENV
fi
shell: bash
- name: Check if ocaml_binary
id: check_ocaml
run: |
OUTPUT=$(cat buck_graph_results.json)
if [[ "$OUTPUT" == *"ocaml_binary"* ]]; then
echo "uses_ocaml=true" >> $GITHUB_ENV
fi
shell: bash
- name: Check if python_binary
id: check_python
run: |
OUTPUT=$(cat buck_graph_results.json)
if [[ "$OUTPUT" == *"python_binary"* ]]; then
echo "uses_python=true" >> $GITHUB_ENV
fi
shell: bash
outputs:
uses_rust: ${{ env.uses_rust }}
uses_cxx: ${{ env.uses_cxx }}
uses_ocaml: ${{env.uses_ocaml}}
uses_python: ${{env.uses_python}}
mac-os-buck-build-and-test:
needs: get-toolchains-to-install
runs-on: macos-latest
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/.github:$PKG_CONFIG_PATH
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: facebook/install-dotslash@latest
- name: Install Rust toolchain
if: needs.get-toolchains-to-install.outputs.uses_rust == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Install C++ toolchain
if: needs.get-toolchains-to-install.outputs.uses_cxx == 'true'
run: |
brew install cmake llvm cppcheck python3 conan@1
shell: bash
- name: Install OCaml toolchain
if: needs.get-toolchains-to-install.outputs.uses_ocaml == 'true'
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "5.1"
- name: Install Python toolchain
if: needs.get-toolchains-to-install.outputs.uses_python == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install homebrew deps
run: |
BUCK_GRAPH=$(./buck2 cquery "attrregexfilter(labels, 'third-party:homebrew:', deps(//fizz/...))" --json --output-attribute=labels)
HOMEBREW_PACKAGES=$(echo $BUCK_GRAPH | jq '[.[] | .labels] | flatten | unique | map(select(contains("third-party:homebrew:")) | sub("third-party:homebrew:"; "")) | .[] | @text')
echo $HOMEBREW_PACKAGES | xargs brew install pkg-config
- name: Checkout libaegis
uses: actions/checkout@v4
with:
repository: jedisct1/libaegis
path: tools/libaegis
- name: Setup libaegis
run: |
brew install zig
cd tools/libaegis
zig build -Drelease
- name: buck2 build and test
run: |
bash oss_buck_build_and_test.sh
ubuntu-os-buck-build-and-test:
needs: get-toolchains-to-install
runs-on: ubuntu-latest
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/tools/liboqs/build/src:${{ github.workspace }}/.github
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: facebook/install-dotslash@latest
- name: Install Rust toolchain
if: needs.get-toolchains-to-install.outputs.uses_rust == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Install C++ toolchain
if: needs.get-toolchains-to-install.outputs.uses_cxx == 'true'
run: |
sudo apt-get install cmake llvm cppcheck python3-pip
sudo pip3 install conan==1.*
shell: bash
- name: Install OCaml toolchain
if: needs.get-toolchains-to-install.outputs.uses_ocaml == 'true'
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "5.1"
- name: Install Python toolchain
if: needs.get-toolchains-to-install.outputs.uses_python == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install ubuntu deps
run: |
BUCK_GRAPH=$(./buck2 cquery "attrregexfilter(labels, 'third-party:ubuntu:', deps(//fizz/...))" --json --output-attribute=labels)
UBUNTU_PACKAGES=$(echo $BUCK_GRAPH | jq '[.[] | .labels] | flatten | unique | map(select(contains("third-party:ubuntu:")) | sub("third-party:ubuntu:"; "")) | .[] | @text')
echo $UBUNTU_PACKAGES | xargs sudo apt-get install -y
- run: |
sudo apt-get update
sudo apt install -y libfmt-dev libdouble-conversion-dev
- name: Checkout liboqs
uses: actions/checkout@v4
with:
repository: open-quantum-safe/liboqs
path: tools/liboqs
- name: Setup liboqs
run: |
sudo apt install astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind
cd tools/liboqs
mkdir build && cd build
cmake -GNinja ..
- name: buck2 build and test
run: bash oss_buck_build_and_test.sh
windows-os-buck-build-and-test:
needs: get-toolchains-to-install
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: facebook/install-dotslash@latest
- name: Install Rust toolchain
if: needs.get-toolchains-to-install.outputs.uses_rust == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Install C++ toolchain
if: needs.get-toolchains-to-install.outputs.uses_cxx == 'true'
run: |
choco install llvm cmake conan cppcheck -y
if ($LASTEXITCODE -eq 3010) { $LASTEXITCODE = 0 }
shell: pwsh
- name: Install OCaml toolchain
if: needs.get-toolchains-to-install.outputs.uses_ocaml == 'true'
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "4.12.0"
- name: Install Python toolchain
if: needs.get-toolchains-to-install.outputs.uses_python == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: buck2 build and test
run: bash oss_buck_build_and_test.sh