Skip to content

Merge pull request #43 from k9withabone/generate #17

Merge pull request #43 from k9withabone/generate

Merge pull request #43 from k9withabone/generate #17

Workflow file for this run

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
- id: conmon_version
run: echo version="$(conmon --version | head -n 1)" >> $GITHUB_OUTPUT
- 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
# There is a regression in conmon v2.1.9 which causes this step to fail.
# See https://github.com/containers/conmon/issues/475
if: ${{ ! contains(steps.conmon_version.outputs.version, '2.1.9') }}
run: podman run localhost/podlet -h