-
Notifications
You must be signed in to change notification settings - Fork 76
57 lines (47 loc) · 1.93 KB
/
ci.yml
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
name: codejail-ci
on:
push:
branches:
- master
pull_request:
jobs:
codejail_ci:
name: tests
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- python_version: '3.8'
docker_tag: latest
- python_version: '3.11'
docker_tag: '3.11'
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TOOLS_EDX_ECR_USER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TOOLS_EDX_ECR_USER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Parse custom apparmor profile
run: sudo apparmor_parser -r -W apparmor-profiles/home.sandbox.codejail_sandbox-python3.bin.python
- name: Pull codejail CI image
run: docker pull 257477529851.dkr.ecr.us-east-1.amazonaws.com/openedx-codejail:latest
- name: Build latest code changes into CI image
run: |
docker build --cache-from 257477529851.dkr.ecr.us-east-1.amazonaws.com/openedx-codejail \
-t 257477529851.dkr.ecr.us-east-1.amazonaws.com/openedx-codejail \
--build-arg python_version=${{ matrix.python_version }} .
- name: Run container with custom apparmor profile and codejail CI image
run: |
docker run --name=codejail --privileged -d --security-opt apparmor=apparmor_profile \
257477529851.dkr.ecr.us-east-1.amazonaws.com/openedx-codejail tail -f /dev/null
- name: Run Non Proxy Tests
run: docker exec -t codejail bash -c 'make clean && make test_no_proxy'
- name: Run Proxy Tests
run: docker exec -t codejail bash -c 'make clean && make test_proxy'
- name: Run Quality Tests
run: docker exec -t codejail bash -c 'make quality'