Repository navigation
79 lines (74 loc) · 2.79 KB
/
Copy pathci.yaml
File metadata and controls
79 lines (74 loc) · 2.79 KB
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
73
74
75
76
77
78
79
# Lints the scripts and builds every kit for both platforms. On each push to
# main, it then pushes the kits to Docker Hub with the tag latest. The sandbox
# tests (make smoke, make project-config, make e2e) need KVM or Apple silicon,
# which GitHub-hosted runners do not have, so they run on a developer machine.
name: CI
on:
push:
branches: [main]
pull_request:
# The release workflow runs lint and build first. The publish job does not
# run there, because the event is not a push.
workflow_call:
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Check shell scripts
run: scripts/lint.sh
- name: Check workflows
run: docker run --rm -v "$PWD:/repo" -w /repo rhysd/actionlint:latest -color
build:
name: Build kits
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
# The build pulls both agent kits for both platforms. A hosted runner
# does not have enough free disk for that until these unused toolchains
# are removed.
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
docker system prune --all --force
df -h /
- uses: docker/setup-qemu-action@v4
# A kit set can list only published kits, so the mixin goes to a local
# registry first. The build fails on the known ways to break a set,
# such as a component with different descriptors per platform.
- name: Start the local registry
run: scripts/local-registry.sh
- name: Build the mixin and the sets
run: scripts/build.sh --registry localhost:5055 --platform linux/amd64,linux/arm64
# The docker-push environment holds the Docker Hub token. It accepts only
# main. The token can push to many localstack repositories.
publish:
name: Publish latest kits
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [lint, build]
runs-on: ubuntu-24.04
environment:
name: docker-push
deployment: false
# A newer push waits for the running publish, so latest ends on the newest
# commit.
concurrency:
group: publish-latest
cancel-in-progress: false
steps:
- uses: actions/checkout@v7
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
docker system prune --all --force
df -h /
- uses: docker/setup-qemu-action@v4
- uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
- name: Build and push the kits as latest
run: scripts/build.sh --latest