forked from orbsmiv/docker-shairport-sync-rpi
-
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (65 loc) · 2.47 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI
on: [push, pull_request]
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checks-out repository
uses: actions/checkout@v4
with:
submodules: true
- name: Enable cache
uses: actions/cache@v4
with:
path: $GITHUB_WORKSPACE/cache
key: cache
- name: Prepare directories
run: |
sudo mkdir -p "$GITHUB_WORKSPACE/cache/apt"
sudo mkdir -p "$GITHUB_WORKSPACE/cache/certs"
sudo mkdir -p "$GITHUB_WORKSPACE/cache/bin"
sudo chown -R 2000:root "$GITHUB_WORKSPACE/cache/apt"
sudo chown -R 2000:root "$GITHUB_WORKSPACE/cache/certs"
sudo chown -R $(id -u) "$GITHUB_WORKSPACE/cache/bin"
- name: Start apt proxy
run: |
docker run --rm -d --expose 443 --expose 80 --pull always \
--name apt-front \
--read-only \
--cap-drop=ALL \
--cap-add=CAP_NET_BIND_SERVICE \
--env TLS_AUTO=ignore_loaded_certs \
--env TLS=internal \
--env IS_PROXY=true \
--env DOMAIN=apt-front.local \
--env PORT=443 \
--env PORT_HTTP=80 \
--env ADDITIONAL_DOMAINS=*.debian.org \
--volume "$GITHUB_WORKSPACE/cache/certs":/certs \
--volume "$GITHUB_WORKSPACE/cache/apt":/data \
docker.io/dubodubonduponey/aptutil:bullseye-2021-08-01
- name: test
run: |
# Set the path and install the tools
export PATH="$HOME/bin:$PATH"
./hack/helpers/install-tools.sh
# Start buildkit
bkaddr="$(./hack/helpers/start-buildkit.sh 2>/dev/null)"
# Sanity check
echo "Sanity checks"
cue version
hadolint --version
shellcheck --version
buildctl --version
buildctl --addr "$bkaddr" debug workers
docker logs --tail 200 apt-front
# Lint
./hack/lint.sh
# Test, with our injected proxy and environment
./hack/test.sh \
--inject bk="$bkaddr" \
--inject ip="$(docker inspect apt-front | jq -rc .[0].NetworkSettings.Networks.bridge.IPAddress)" \
--inject trust="$(sudo cat "$GITHUB_WORKSPACE/cache/certs/pki/authorities/local/root.crt")" \
".github/workflows/environment.cue"