2024-05-16 06:52:22 +01:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ["next"]
|
|
|
|
pull_request:
|
|
|
|
branches: ["main"]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: docker
|
2024-09-17 09:59:13 +01:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
toolchain:
|
|
|
|
- name: stable
|
|
|
|
- name: nightly
|
2024-05-16 06:52:22 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-09-22 15:22:24 +01:00
|
|
|
- name: Check TODOs
|
2024-11-28 19:04:09 +00:00
|
|
|
uses: kemitix/todo-checker@v1.2.0
|
2024-09-22 15:22:24 +01:00
|
|
|
|
2024-09-17 14:50:13 +01:00
|
|
|
- name: Machete
|
2024-12-02 23:01:53 +00:00
|
|
|
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
|
2024-09-17 14:50:13 +01:00
|
|
|
with:
|
|
|
|
args: ${{ matrix.toolchain.name }} cargo machete
|
|
|
|
|
2024-05-16 06:52:22 +01:00
|
|
|
- name: Format
|
2024-12-02 23:01:53 +00:00
|
|
|
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
|
2024-05-16 06:52:22 +01:00
|
|
|
with:
|
2024-09-17 09:59:13 +01:00
|
|
|
args: ${{ matrix.toolchain.name }} cargo fmt --all -- --check
|
2024-05-16 06:52:22 +01:00
|
|
|
|
|
|
|
- name: Clippy
|
2024-12-02 23:01:53 +00:00
|
|
|
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
|
2024-05-16 06:52:22 +01:00
|
|
|
with:
|
2024-09-17 09:59:13 +01:00
|
|
|
args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset clippy
|
2024-05-16 06:52:22 +01:00
|
|
|
|
|
|
|
- name: Build
|
2024-12-02 23:01:53 +00:00
|
|
|
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
|
2024-05-16 06:52:22 +01:00
|
|
|
with:
|
2024-09-17 09:59:13 +01:00
|
|
|
args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset build
|
2024-05-16 06:52:22 +01:00
|
|
|
|
|
|
|
- name: Test
|
2024-12-02 23:01:53 +00:00
|
|
|
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
|
2024-05-16 06:52:22 +01:00
|
|
|
with:
|
2024-09-17 09:59:13 +01:00
|
|
|
args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset test
|
2024-12-27 14:02:39 +00:00
|
|
|
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Login to Forgejo
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: git.kemitix.net
|
|
|
|
username: ${{ vars.FORGEJO_USERNAME }}
|
|
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
|
|
|
|
|
# - name: Set up Docker Buildx
|
|
|
|
# uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
# - name: Docker info (all setup)
|
|
|
|
# run: docker info
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: ./
|
|
|
|
push: false # don't push on next, only on main
|
|
|
|
tags: git.kemitix.net/${{ vars.FORGEJO_USERNAME }}/${{ vars.FORGEJO_IMAGE_NAME }}:latest
|