Skip to content

Commit 7fc9a90

Browse files
committed
Add a mainline build to test the mainline.sh script
1 parent 76d0da4 commit 7fc9a90

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,17 @@ jobs:
8282
with:
8383
name: artifacts
8484
path: ./out/artifacts
85+
86+
Mainline:
87+
runs-on: ubuntu-latest
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v4
91+
- name: Install Dependencies
92+
run: |
93+
sudo apt-get update
94+
sudo apt-get install -y cmake clang
95+
./scripts/ossfuzzdeps.sh
96+
- name: Compile mainline
97+
run: |
98+
./mainline.sh

scripts/ossfuzzdeps.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@
88
set -ex
99
SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010

11+
# Work out if we need to install with sudo or not.
12+
if [[ $(id -u) -eq 0 ]]
13+
then
14+
# We are root, so we can install without sudo.
15+
echo "Running as root, no sudo required."
16+
export SUDO=""
17+
else
18+
# We are not root, so we need to use sudo.
19+
echo "Running as non-root, using sudo."
20+
export SUDO="sudo"
21+
fi
22+
1123
# Download dependencies for oss-fuzz
12-
apt-get update
13-
apt-get install -y make \
24+
$SUDO apt-get update
25+
$SUDO apt-get install -y make \
1426
autoconf \
1527
automake \
1628
libtool \

0 commit comments

Comments
 (0)