-
Notifications
You must be signed in to change notification settings - Fork 13
71 lines (60 loc) · 2.06 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --verbose --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy -- -Dwarnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose
build-container:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
# From https://podman.io/docs/installation#ubuntu
# There is a bug in earlier versions of buildah/podman where the TARGETPLATFORM arg is not set correctly
- name: Upgrade podman
run: |
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL \
"https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/Release.key" \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null && \
sudo apt update && \
sudo apt install -y podman
- run: podman version
- name: Build ARM image
run: podman build --platform linux/arm64/v8 -t podlet .
- name: Build x86 image
run: podman build --platform linux/amd64 -t podlet .
- name: Test run image
run: podman run localhost/podlet -h