80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
# Based on: https://pastebin.com/99Fq2b2w
|
|
name: Build and deploy automation_rs
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- feature/actions
|
|
|
|
jobs:
|
|
|
|
format:
|
|
name: cargo fmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
shared-key: "automation_rs"
|
|
- name: Rustfmt check
|
|
uses: actions-rust-lang/rustfmt@v1
|
|
|
|
clippy:
|
|
name: cargo clippy
|
|
runs-on: ubuntu-latest
|
|
needs: [format]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
shared-key: "automation_rs"
|
|
- name: Clippy
|
|
run: cargo clippy --all-targets --all -- -D warnings
|
|
|
|
build:
|
|
name: cargo build
|
|
runs-on: ubuntu-latest
|
|
needs: [clippy]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
shared-key: "automation_rs"
|
|
- name: Build
|
|
run: cargo build --release
|
|
|
|
# create-docker-container:
|
|
# name: docker build
|
|
# runs-on: ubuntu-latest
|
|
# needs: [build]
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
# - uses: Swatinem/rust-cache@v2
|
|
# with:
|
|
# shared-key: "automation_rs"
|
|
# - run: ls -alh
|
|
|
|
# create-docker-container:
|
|
# runs-on: ubuntu-latest
|
|
# container: catthehacker/ubuntu:act-latest
|
|
# steps:
|
|
# - name: Checkout repository
|
|
# uses: https://github.com/actions/checkout@v3
|
|
#
|
|
# - name: Set up Docker BuildX
|
|
# uses: https://github.com/docker/setup-buildx-action@v3
|
|
#
|
|
# - name: Login to registry
|
|
# uses: https://github.com/docker/login-action@v3
|
|
# with:
|
|
# registry: git.huizinga.dev
|
|
# username: ${{ gitea.actor }}
|
|
# password: ${{ secrets.REGISTRY_TOKEN }}
|
|
#
|
|
# - name: Build and push Docker image
|
|
# uses: https://github.com/docker/build-push-action@v5
|
|
# with:
|
|
# context: .
|
|
# push: true
|
|
# tags: git.huizinga.dev/dreaded_x/automation_rs:latest
|