Update github actions #99
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI checks for every commit | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
on: | |
push: | |
pull_request: | |
jobs: | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install toolchain | |
run: | | |
rustup set auto-self-update disable | |
rustup toolchain install nightly --profile minimal | |
rustup component add rustfmt --toolchain nightly | |
- run: cargo +nightly fmt --all --check | |
docker: | |
name: Build master Docker image | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/master' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v5 | |
with: | |
tags: ghcr.io/bbaovanc/bobashare:master | |
push: true | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build: | |
- {os: "ubuntu-latest", target: "x86_64-unknown-linux-musl"} | |
- {os: "ubuntu-latest", target: "arm-unknown-linux-musleabihf"} | |
- {os: "ubuntu-latest", target: "armv7-unknown-linux-musleabihf"} | |
- {os: "ubuntu-latest", target: "aarch64-unknown-linux-musl"} | |
- {os: "windows-latest", target: "x86_64-pc-windows-gnu"} | |
- {os: "windows-latest", target: "x86_64-pc-windows-msvc"} | |
- {os: "macos-latest", target: "x86_64-apple-darwin"} | |
- {os: "macos-latest", target: "aarch64-apple-darwin"} | |
name: Build | |
runs-on: ${{ matrix.build.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get version name | |
id: version | |
# thanks windows | |
shell: bash | |
run: | | |
echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_OUTPUT | |
- name: Install toolchain | |
run: | | |
rustup set auto-self-update disable | |
rustup toolchain install stable --profile minimal | |
rustup toolchain install nightly --profile minimal | |
rustup target add ${{ matrix.build.target }} | |
rustup component add clippy --toolchain nightly | |
- name: Check | |
run: | | |
cargo clippy --locked -- -D warnings | |
cargo clippy --release --locked -- -D warnings | |
- name: Build | |
if: always() | |
run: | | |
cargo build --locked | |
cargo build --release --locked | |
- name: Test | |
run: | | |
cargo test --locked | |
cargo test --release --locked | |
- name: Upload debug artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug-build-${{ steps.version.outputs.VERSION }}-${{ matrix.build.target }} | |
path: | | |
target/debug/bobashare-admin | |
target/debug/bobashare-web | |
target/debug/bobashare-admin.exe | |
target/debug/bobashare-web.exe | |
- name: Upload release artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-build-${{ steps.version.outputs.VERSION }}-${{ matrix.build.target }} | |
path: | | |
target/release/bobashare-admin | |
target/release/bobashare-web | |
target/release/bobashare-admin.exe | |
target/release/bobashare-web.exe |