-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (96 loc) · 3.16 KB
/
Copy pathdemo.yaml
File metadata and controls
112 lines (96 loc) · 3.16 KB
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
name: CPP-ARGON Demo
on:
push:
branches:
- "*"
paths:
- .github/workflows/demo.yaml
- .gitmodules
- cpp-argon-demo
- include/**
- CMakeLists.txt
- MODULE.bazel
- BUILD.bazel
pull_request:
branches:
- master
jobs:
build-demo-linux:
name: Build cpp-argon-demo (Linux)
runs-on: ubuntu-24.04
steps:
- name: Check out current branch
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Sync submodules
run: git submodule sync --recursive
- name: Update submodules
run: git submodule update --init --recursive
- name: Determine Current Branch
id: branch-name
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
else
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
fi
- name: Build cpp-argon-demo (CMake)
run: |
cd cpp-argon-demo
cmake -B build_cmake -DARGON_TAG=${{ steps.branch-name.outputs.branch }}
cmake --build build_cmake/ -j 4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Build cpp-argon-demo (Bazel)
run: |
cd cpp-argon-demo
BRANCH="${{ steps.branch-name.outputs.branch }}"
sed -i "s/branch = \".*\"/branch = \"$BRANCH\"/" MODULE.bazel
bazel build //:all_demos
build-demo-windows:
name: Build cpp-argon-demo (Windows)
runs-on: windows-2022
steps:
- name: Check out current branch
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Sync submodules
run: git submodule sync --recursive
shell: bash
- name: Update submodules
run: git submodule update --init --recursive
shell: bash
- name: Determine Current Branch
id: branch-name
run: |
if ("${{ github.event_name }}" -eq "pull_request") {
"branch=${{ github.event.pull_request.head.ref }}" >> $env:GITHUB_OUTPUT
} else {
$branch = "${env:GITHUB_REF}".Replace("refs/heads/", "")
"branch=$branch" >> $env:GITHUB_OUTPUT
}
- name: Build cpp-argon-demo (CMake)
run: |
cd cpp-argon-demo
cmake -B build_cmake -DARGON_TAG=${{ steps.branch-name.outputs.branch }}
cmake --build build_cmake/ --config Release -j 4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Build cpp-argon-demo (Bazel)
run: |
cd cpp-argon-demo
$BRANCH="${{ steps.branch-name.outputs.branch }}"
(Get-Content MODULE.bazel) -replace 'branch = ".*"', "branch = `"$BRANCH`"" | Set-Content MODULE.bazel
bazel build //:all_demos