Add link to exact Git repo at commit/tag #327
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: Build | |
on: [ push, pull_request ] | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: 'x86_64-pc-windows-msvc' | |
os: windows | |
- target: 'x86_64-unknown-linux-gnu' | |
os: ubuntu | |
- target: 'x86_64-unknown-linux-musl' | |
os: ubuntu | |
- target: 'aarch64-unknown-linux-gnu' | |
os: ubuntu | |
- target: 'aarch64-unknown-linux-musl' | |
os: ubuntu | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install musl Dependencies | |
if: contains(matrix.target, 'musl') | |
run: sudo apt-get update && sudo apt-get install musl-tools | |
- name: Install aarch64 Dependencies | |
if: contains(matrix.target, 'aarch64') | |
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu | |
- name: Setup aarch64 musl compiler | |
if: contains(matrix.target, 'aarch64') && contains(matrix.target, 'musl') | |
run: | | |
wget https://musl.cc/aarch64-linux-musl-cross.tgz | |
tar -xvzf aarch64-linux-musl-cross.tgz | |
echo "CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc" >> "$GITHUB_ENV" | |
- name: Install Target | |
run: rustup target add ${{ matrix.target }} | |
- name: Setup Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --release --target=${{ matrix.target }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Intellectual-${{ matrix.target }} | |
if-no-files-found: ignore | |
path: | | |
target/${{ matrix.target }}/release/intellectual | |
target/${{ matrix.target }}/release/intellectual.exe | |
code-style: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Check rustfmt | |
run: cargo fmt --all -- --check | |
- name: Check Clippy | |
run: cargo clippy -- -D warnings |