mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Use custom base image for CI
This commit is contained in:
parent
e7e13a41f0
commit
e814cd6c20
2 changed files with 53 additions and 98 deletions
|
@ -8,14 +8,11 @@ jobs:
|
||||||
clippy:
|
clippy:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: docker.io/node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout pict-rs
|
name: Checkout pict-rs
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
-
|
|
||||||
name: Setup Rust
|
|
||||||
uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
|
||||||
-
|
-
|
||||||
name: Clippy
|
name: Clippy
|
||||||
run: |
|
run: |
|
||||||
|
@ -25,20 +22,18 @@ jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: docker.io/node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout pict-rs
|
name: Checkout pict-rs
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
-
|
|
||||||
name: Setup Rust
|
|
||||||
uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
run: cargo test
|
run: cargo test
|
||||||
|
|
||||||
check:
|
check:
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- x86_64-unknown-linux-musl
|
- x86_64-unknown-linux-musl
|
||||||
|
@ -46,19 +41,11 @@ jobs:
|
||||||
- aarch64-unknown-linux-musl
|
- aarch64-unknown-linux-musl
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: docker.io/node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout pict-rs
|
name: Checkout pict-rs
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
-
|
|
||||||
name: Setup Rust
|
|
||||||
uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
|
||||||
with:
|
|
||||||
targets: |
|
|
||||||
["x86_64-unknown-linux-musl",
|
|
||||||
"armv7-unknown-linux-musleabihf",
|
|
||||||
"aarch64-unknown-linux-musl"]
|
|
||||||
-
|
-
|
||||||
name: Debug builds
|
name: Debug builds
|
||||||
run: cargo zigbuild --target ${{ matrix.target }}
|
run: cargo zigbuild --target ${{ matrix.target }}
|
||||||
|
|
|
@ -5,49 +5,43 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY_IMAGE: asonix/pictrs
|
REGISTRY_IMAGE: asonix/pictrs
|
||||||
DOCKER_HOST: tcp://docker-in-docker:2375
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# clippy:
|
clippy:
|
||||||
# runs-on: docker
|
runs-on: base-image
|
||||||
# container:
|
container:
|
||||||
# image: docker.io/node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
# steps:
|
steps:
|
||||||
# -
|
-
|
||||||
# name: Checkout pict-rs
|
name: Checkout pict-rs
|
||||||
# uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
# -
|
-
|
||||||
# name: Setup Rust
|
name: Clippy
|
||||||
# uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
run: |
|
||||||
# -
|
cargo clippy --no-default-features -- -D warnings
|
||||||
# name: Clippy
|
cargo clippy --no-default-features --features io-uring -- -D warnings
|
||||||
# run: |
|
|
||||||
# cargo clippy --no-default-features -- -D warnings
|
|
||||||
# cargo clippy --no-default-features --features io-uring -- -D warnings
|
|
||||||
|
|
||||||
# tests:
|
tests:
|
||||||
# runs-on: docker
|
|
||||||
# container:
|
|
||||||
# image: docker.io/node:20-bookworm
|
|
||||||
# steps:
|
|
||||||
# -
|
|
||||||
# name: Checkout pict-rs
|
|
||||||
# uses: https://github.com/actions/checkout@v4
|
|
||||||
# -
|
|
||||||
# name: Setup Rust
|
|
||||||
# uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
|
||||||
# -
|
|
||||||
# name: Test
|
|
||||||
# run: cargo test
|
|
||||||
|
|
||||||
build:
|
|
||||||
# needs:
|
|
||||||
# - clippy
|
|
||||||
# - tests
|
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: docker.io/node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout pict-rs
|
||||||
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Test
|
||||||
|
run: cargo test
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs:
|
||||||
|
- clippy
|
||||||
|
- tests
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
info:
|
info:
|
||||||
- target: x86_64-unknown-linux-musl
|
- target: x86_64-unknown-linux-musl
|
||||||
|
@ -63,20 +57,6 @@ jobs:
|
||||||
-
|
-
|
||||||
name: Checkout pict-rs
|
name: Checkout pict-rs
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
-
|
|
||||||
name: Install Docker
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y ca-certificates curl jq
|
|
||||||
install -m 0755 -d /etc/apt/keyrings
|
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
|
||||||
chmod a+r /etc/apt/keyrings/docker.asc
|
|
||||||
echo \
|
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
|
||||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
|
||||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
||||||
-
|
-
|
||||||
name: Prepare Platform
|
name: Prepare Platform
|
||||||
run: |
|
run: |
|
||||||
|
@ -89,6 +69,15 @@ jobs:
|
||||||
uses: https://github.com/docker/metadata-action@v5
|
uses: https://github.com/docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY_IMAGE }}
|
images: ${{ env.REGISTRY_IMAGE }}
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
suffix=-${{ matrix.info.artifact }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable={{ is_default_branch }}
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=ref,event=branch
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: https://github.com/docker/setup-qemu-action@v3
|
uses: https://github.com/docker/setup-qemu-action@v3
|
||||||
|
@ -101,14 +90,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
|
||||||
name: Setup Rust
|
|
||||||
uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
|
||||||
with:
|
|
||||||
targets: |
|
|
||||||
["x86_64-unknown-linux-musl",
|
|
||||||
"armv7-unknown-linux-musleabihf",
|
|
||||||
"aarch64-unknown-linux-musl"]
|
|
||||||
-
|
-
|
||||||
name: Compile pict-rs
|
name: Compile pict-rs
|
||||||
run: cargo zigbuild --target ${{ matrix.info.target }} --release
|
run: cargo zigbuild --target ${{ matrix.info.target }} --release
|
||||||
|
@ -132,10 +113,10 @@ jobs:
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./docker/forgejo
|
context: ./docker/forgejo
|
||||||
# file: ./docker/forgejo/Dockerfile
|
|
||||||
platforms: ${{ matrix.info.platform }}
|
platforms: ${{ matrix.info.platform }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true
|
||||||
-
|
-
|
||||||
name: Export digest
|
name: Export digest
|
||||||
run: |
|
run: |
|
||||||
|
@ -156,23 +137,9 @@ jobs:
|
||||||
publish-docker:
|
publish-docker:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: docker.io/node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
needs: [build]
|
needs: [build]
|
||||||
steps:
|
steps:
|
||||||
-
|
|
||||||
name: Install Docker
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y ca-certificates curl jq
|
|
||||||
install -m 0755 -d /etc/apt/keyrings
|
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
|
||||||
chmod a+r /etc/apt/keyrings/docker.asc
|
|
||||||
echo \
|
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
|
||||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
|
||||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
||||||
-
|
-
|
||||||
name: Download digests
|
name: Download digests
|
||||||
uses: https://github.com/actions/download-artifact@v3
|
uses: https://github.com/actions/download-artifact@v3
|
||||||
|
@ -196,10 +163,14 @@ jobs:
|
||||||
uses: https://github.com/docker/metadata-action@v5
|
uses: https://github.com/docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY_IMAGE }}
|
images: ${{ env.REGISTRY_IMAGE }}
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
tags: |
|
tags: |
|
||||||
|
type=raw,value=latest,enable={{ is_default_branch }}
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
|
type=ref,event=branch
|
||||||
-
|
-
|
||||||
name: Create manifest list and push
|
name: Create manifest list and push
|
||||||
working-directory: /tmp/digests
|
working-directory: /tmp/digests
|
||||||
|
@ -218,7 +189,7 @@ jobs:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/download-artifact@v3
|
- uses: https://github.com/actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -236,14 +207,11 @@ jobs:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: node:20-bookworm
|
image: docker.io/asonix/actions-base-image:0.1
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout pict-rs
|
name: Checkout pict-rs
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
-
|
|
||||||
name: Setup Rust
|
|
||||||
uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
|
|
||||||
-
|
-
|
||||||
name: Publish Crate
|
name: Publish Crate
|
||||||
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
|
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
|
||||||
|
|
Loading…
Reference in a new issue