-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·36 lines (25 loc) · 839 Bytes
/
run-tests.sh
File metadata and controls
executable file
·36 lines (25 loc) · 839 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
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
CODEQL_VERSION=2.16.4
set -o errexit
set -o nounset
set -o pipefail
OS=linux64
if [[ "$OSTYPE" == "darwin"* ]] ; then
OS=osx64
fi
# TODO Add Windows support?
TMPDIR="$( mktemp -d -t 'jenkins-codeql-tests.XXX' )"
echo "Using temp dir $TMPDIR ..." >&2
cd "$TMPDIR"
echo "Downloading CodeQL CLI ..." >&2
curl --location --silent --fail --output codeql.zip "https://github.com/github/codeql-cli-binaries/releases/download/v$CODEQL_VERSION/codeql-${OS}.zip"
echo "Extracting CodeQL CLI ..." >&2
unzip -q codeql.zip # Into codeql/ directory
export PATH="$PATH:$PWD/codeql/"
cd - >/dev/null
echo "Downloading query pack dependencies ..." >&2
codeql pack install test/
echo "Running query tests ..." >&2
codeql test run test/
# TODO this doesn't run when tests fail, but perhaps useful for debug?
rm -rf "$TMPDIR"