Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 7dda019

Browse files
author
Sam Lanning
authored
Merge pull request #5 from github/update-ci
Update ci
2 parents 7391fc4 + 3a1ddda commit 7dda019

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
uses: actions/checkout@v1
1212

1313
- name: Build Images & Run Queries
14-
run: cd courses/cpp/ctf-segv/image && ./test.sh
14+
run: cd courses/cpp/ctf-segv && ../../../scripts/test-course.sh
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

courses/cpp/ctf-segv/image/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

courses/cpp/ctf-segv/image/test.sh renamed to scripts/test-course.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
#! /bin/bash
22

3-
# Test that the queries in ../answers produce the expected results
3+
# Build the codeql-learninglab-check & course image, and run all queries in
4+
# the course to ensure the expected result
5+
#
6+
# Should be run with the cwd being the course folder
47

58
set -e
69
set -x
710

8-
TMP=$PWD/tmp
11+
TMP=$(mktemp -d -t ci-XXXXXXXXXX)
912
# Extract the expected parent tag from course Dockerfile
10-
PARENT_TAG=$(head -n 1 Dockerfile | awk -F ' ' '{print $2}')
13+
PARENT_TAG=$(head -n 1 image/Dockerfile | awk -F ' ' '{print $2}')
1114
TAG=ci-test
1215

1316
# Build codeql-learninglab-check
14-
docker build -t $PARENT_TAG ../../../../codeql-learninglab-check
17+
docker build -t $PARENT_TAG ../../../codeql-learninglab-check
1518

1619
# Build course image
17-
docker build -t $TAG .
20+
docker build -t $TAG image
1821

1922
# Prepare temporary folder to mount into docker
2023
mkdir -p $TMP
21-
cp -R ../answers $TMP/answers
24+
cp -R answers $TMP/answers
2225
echo "{}" > $TMP/event.json
2326

2427
# Run docker image

0 commit comments

Comments
 (0)