-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (69 loc) · 2.5 KB
/
pr.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
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Test
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
binary:
- alisa
- elisa
- elisheba
- elizabeth
- isabel
steps:
- uses: actions/checkout@v4
- name: Log into registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Test
run: |
IMAGE_ID=ghcr.io/chipp/${{ matrix.binary }}
RUST_VERSION=$(cat .rust-version)
docker buildx build . --file bin/${{ matrix.binary }}/test.Dockerfile \
--load \
--tag $IMAGE_ID:latest \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--cache-from=type=registry,ref=$IMAGE_ID:test-cache \
--cache-to=type=registry,ref=$IMAGE_ID:test-cache,mode=max
docker buildx build . --file bin/${{ matrix.binary }}/Dockerfile \
--load \
--tag $IMAGE_ID:latest \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--cache-from=type=registry,ref=$IMAGE_ID:cache \
--cache-to=type=registry,ref=$IMAGE_ID:cache,mode=max
test-isabel-libs:
runs-on: ubuntu-latest
strategy:
matrix:
build_arch:
- arm64
- amd64
host_arch:
- arm64
- amd64
steps:
- uses: actions/checkout@v4
- name: Log into registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Test
run: |
IMAGE_ID=ghcr.io/chipp/isabel
RUST_VERSION=$(cat .rust-version)
TEST_TAG=test-cache-libs-${{ matrix.build_arch }}-${{ matrix.host_arch }}
docker buildx build . --file bin/isabel/test_libs/${{ matrix.host_arch }}.Dockerfile \
--load \
--platform linux/${{ matrix.build_arch }} \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--cache-from=type=registry,ref=$IMAGE_ID:TEST_TAG \
--cache-to=type=registry,ref=$IMAGE_ID:$TEST_TAG,mode=max