Bump KyleMayes/install-llvm-action from 1.8.3 to 1.9.0 #916
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
# GitHub Workflows file | |
name: main | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
build_and_test: | |
name: Build and test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: | |
- macos-aarch64 | |
- macos-x86_64 | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
- windows | |
include: | |
- build: ubuntu-20.04 | |
os: ubuntu-20.04 | |
mkcmd: ./tools/mkdeb.sh -d focal | |
- build: ubuntu-22.04 | |
os: ubuntu-22.04 | |
mkcmd: ./tools/mkdeb.sh -d jammy | |
- build: macos-aarch64 | |
os: macos-latest | |
mkcmd: ./tools/mkpkg.sh -a aarch64 -t aarch64-apple-darwin | |
- build: macos-x86_64 | |
os: macos-latest | |
mkcmd: ./tools/mkpkg.sh | |
- build: windows | |
os: windows-latest | |
mkcmd: ./tools/mkzip.ps1 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- name: Install Rust (macos-aarach64) | |
if: ${{ matrix.build == 'macos-aarch64' }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: aarch64-apple-darwin | |
profile: minimal | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.os }} | |
- name: Install Linux dependency | |
run: sudo apt-get install libkrb5-dev | |
if: startswith(matrix.os, 'ubuntu') | |
# see https://github.com/rust-lang/rust-bindgen/issues/1797 | |
- name: Install Windows dependency (LLVM) | |
uses: KyleMayes/[email protected] | |
if: startswith(matrix.os, 'windows') | |
with: | |
version: "11.0" | |
directory: ${{ runner.temp }}/llvm | |
- name: Set LIBCLANG_PATH | |
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | |
if: startswith(matrix.os, 'windows') | |
- name: Run cargo test | |
run: cargo test | |
- name: Build Release Package | |
id: buildpkg | |
run: ${{ matrix.mkcmd }} | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.buildpkg.outputs.pkgfile }} | |
path: ./${{ steps.buildpkg.outputs.pkgfile }} | |
bazel_build: | |
name: Bazel build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [macos] | |
include: | |
- build: macos | |
os: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Bazel cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bazel_build_cache | |
~/.cache/bazel_repo_cache | |
key: ${{ runner.os }}-bazel-${{ hashFiles('Cargo.Bazel.lock', 'WORKSPACE') }} | |
restore-keys: | | |
${{ runner.os }}-bazel- | |
- name: Bazel build | |
run: bazel build --disk_cache=~/.cache/bazel_build_cache --repository_cache=~/.cache/bazel_repo_cache //macos/app:ProxydetoxApp | |
format_check: | |
name: Rust lint | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
lint: [clippy, fmt] | |
include: | |
- lint: clippy | |
flags: --all | |
- lint: fmt | |
flags: --all -- --check | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
override: true | |
- name: Install Linux dependency | |
run: sudo apt-get install libkrb5-dev | |
if: ${{ matrix.lint == 'clippy' }} | |
- name: Lint check | |
run: cargo ${{ matrix.lint }} ${{ matrix.flags }} |