Add a safe FFI wrapper in wireguard-go-rs #3384
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
--- | ||
Check failure on line 1 in .github/workflows/rust-unused-dependencies.yml GitHub Actions / .github/workflows/rust-unused-dependencies.ymlInvalid workflow file
|
||
name: Rust - Unused dependencies | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/rust-unused-dependencies.yml | ||
- '**/*.rs' | ||
- '**/Cargo.toml' | ||
- 'building/*-container-image.txt' | ||
workflow_dispatch: | ||
env: | ||
# Pinning nightly just to avoid random breakage. It's fine to bump this at any time | ||
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-05-07 | ||
jobs: | ||
prepare-containers: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Fetch container image names | ||
run: | | ||
echo "inner_container_image_linux=$(cat ./building/linux-container-image.txt)" >> $GITHUB_ENV | ||
echo "inner_container_image_android=$(cat ./building/android-container-image.txt)" >> $GITHUB_ENV | ||
outputs: | ||
container_image_linux: ${{ env.inner_container_image_linux }} | ||
container_image_android: ${{ env.inner_container_image_android }} | ||
cargo-udeps-linux: | ||
needs: prepare-containers | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ needs.prepare-containers.outputs.container_image_linux }} | ||
steps: | ||
# Fix for HOME path overridden by GH runners when building in containers, see: | ||
# https://github.com/actions/runner/issues/863 | ||
- name: Fix HOME path | ||
run: echo "HOME=/root" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Checkout submodules | ||
run: | | ||
git config --global --add safe.directory '*' | ||
git submodule update --init --depth=1 dist-assets/binaries wireguard-go-rs/libwg/wireguard-go | ||
- name: Install nightly Rust toolchain | ||
run: rustup default $RUST_NIGHTLY_TOOLCHAIN | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-udeps@0.1.48 | ||
- name: Check for unused dependencies | ||
shell: bash | ||
run: source env.sh && cargo udeps --workspace | ||
cargo-udeps-android: | ||
needs: prepare-containers | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ needs.prepare-containers.outputs.container_image_android }} | ||
steps: | ||
# Fix for HOME path overridden by GH runners when building in containers, see: | ||
# https://github.com/actions/runner/issues/863 | ||
- name: Fix HOME path | ||
run: echo "HOME=/root" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Checkout wireguard-go submodule | ||
run: | | ||
git config --global --add safe.directory '*' | ||
git submodule update --init --depth=1 wireguard-go-rs/libwg/wireguard-go | ||
- name: Install nightly Rust toolchain | ||
run: | | ||
rustup default $RUST_NIGHTLY_TOOLCHAIN | ||
rustup target add aarch64-linux-android | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-udeps@0.1.48 | ||
- name: Check for unused dependencies | ||
run: cargo udeps --target aarch64-linux-android --package mullvad-jni | ||
cargo-udeps-windows: | ||
runs-on: windows-latest | ||
cargo-udeps: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1.0.6 | ||
with: | ||
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }} | ||
default: true | ||
profile: minimal | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-udeps@0.1.48 | ||
- name: Install Go | ||
if: matrix.os == 'macos-latest' | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21.3 | ||
- name: Check for unused dependencies | ||
shell: bash | ||
run: cargo udeps --workspace |