mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-06-06 07:41:41 +00:00
ba5452bf6c
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
90 lines
2.7 KiB
YAML
90 lines
2.7 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
check_fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
components: rustfmt
|
|
- uses: clechasseur/rs-fmt-check@v2
|
|
clippy:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Set windows VCPKG_ROOT env variable
|
|
run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
|
if: runner.os == 'Windows'
|
|
- name: Install windows openssl
|
|
run: vcpkg install openssl:x64-windows-static-md
|
|
if: runner.os == 'Windows'
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: giraffate/clippy-action@v1
|
|
with:
|
|
clippy_flags: -- -D warnings
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
check_library:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest,windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Set windows VCPKG_ROOT env variable
|
|
run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
|
if: runner.os == 'Windows'
|
|
- name: Install windows openssl
|
|
run: vcpkg install openssl:x64-windows-static-md
|
|
if: runner.os == 'Windows'
|
|
- uses: actions/checkout@v4
|
|
- name: Build
|
|
run: cargo build -p mycelium --all-features --verbose
|
|
- name: Run tests
|
|
run: cargo test -p mycelium --all-features --verbose
|
|
check_binary:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Set windows VCPKG_ROOT env variable
|
|
run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
|
if: runner.os == 'Windows'
|
|
- name: Install windows openssl
|
|
run: vcpkg install openssl:x64-windows-static-md
|
|
if: runner.os == 'Windows'
|
|
- uses: actions/checkout@v4
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
- name: Run tests
|
|
run: cargo test --verbose
|
|
check_flake:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
permissions:
|
|
id-token: "write"
|
|
contents: "read"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
- uses: DeterminateSystems/flake-checker-action@main
|
|
- name: Run `nix build`
|
|
run: nix build .
|