-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.sh
More file actions
executable file
·28 lines (22 loc) · 845 Bytes
/
ci.sh
File metadata and controls
executable file
·28 lines (22 loc) · 845 Bytes
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
#!/usr/bin/env bash
# Simple test script to run the tests in docker
# Error on any non-zero command, and print the commands as they're run
set -ex
# Make sure we have the docker utility
if ! command -v docker; then
echo "🐋 Please install docker first 🐋"
exit 1
fi
# Set the docker image name to default to repo basename
DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME:-$(basename -s .git "$(git remote --verbose | awk 'NR==1 { print tolower($2) }')")}
# build the docker image
DOCKER_BUILDKIT=1 docker build -t "$DOCKER_IMAGE_NAME" --build-arg "UID=$(id -u)" -f Dockerfile .
docker run --rm -v "$(pwd)":/mnt/workspace -t "$DOCKER_IMAGE_NAME" bash -c "
# commit checker
pre-commit run --all-files
# basic happy path example
make -C example
# check clang-11
CC=clang-11 make -C example
# this test should fail
! make -C example-failing"