Skip to content

Commit

Permalink
👷 CI: rework rust action
Browse files Browse the repository at this point in the history
use archlinux container for CI run instead of build arch package in docker
  • Loading branch information
vnepogodin committed Jan 3, 2025
1 parent bfe252e commit 970745e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 75 deletions.
23 changes: 0 additions & 23 deletions .github/archlinux/Dockerfile

This file was deleted.

80 changes: 28 additions & 52 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,72 +22,48 @@ env:
CARGO_TERM_COLOR: always

jobs:
archlinux:
strategy:
matrix:
arch:
[
"linux/amd64 x86_64"
]
name: "Archlinux ${{ matrix.arch }}"
build:
name: CI
runs-on: ubuntu-latest
container:
image: archlinux
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Read info
id: tags
shell: bash
run: |
arch="${{ matrix.arch }}"
echo ::set-output name=PLATFORM::${arch%% *}
echo ::set-output name=ARCH::${arch##* }
- name: Install Packages
run: pacman -Syu meson clang gcc pciutils --noconfirm --needed

- name: Build ${{ matrix.arch }} release
shell: bash
run: |
docker buildx build --platform ${{ steps.tags.outputs.PLATFORM }} \
--tag cachyos_welcome:${{ steps.tags.outputs.ARCH }} \
-f .github/archlinux/Dockerfile \
--load \
.
- uses: actions/checkout@v4

fmt:
name: rust fmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions-rs/toolchain@v1
- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt

- name: install deps
run: |
sudo apt update
sudo apt install ninja-build libgtk-3-dev
shell: bash

- uses: BSFishy/pip-action@v1
with:
packages: meson
components: rustfmt, clippy

- name: Configure
shell: bash
run: |
meson --buildtype=release --prefix=/usr build
- uses: actions-rs/cargo@v1
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

0 comments on commit 970745e

Please sign in to comment.