This commit is contained in:
parent
88f8f93d89
commit
a53c45aefe
1 changed files with 22 additions and 156 deletions
|
|
@ -7,12 +7,11 @@ on:
|
|||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
NIX_CONFIG: experimental-features = nix-command flakes
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
name: rustfmt
|
||||
checks:
|
||||
name: checks
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
|
@ -22,162 +21,29 @@ jobs:
|
|||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Check formatting
|
||||
- name: Run checks
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command cargo fmt --all --check
|
||||
nix develop --command bash -lc '
|
||||
set -euo pipefail
|
||||
|
||||
clippy:
|
||||
name: clippy
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
cargo fmt --all --check
|
||||
cargo clippy --workspace --exclude mtp-wasm --all-targets --all-features -- -D warnings -W unreachable-pub
|
||||
cargo test --workspace --exclude mtp-wasm --all-features
|
||||
RUSTFLAGS="--cfg web_sys_unstable_apis" cargo build -p mtp-wasm --target wasm32-unknown-unknown
|
||||
cargo deny check advisories bans sources
|
||||
cargo machete
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run dup
|
||||
|
||||
- name: Run clippy
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command mtp-clippy
|
||||
RUSTFLAGS="--cfg web_sys_unstable_apis" wasm-pack build wasm --target web
|
||||
RUSTFLAGS="--cfg web_sys_unstable_apis" pnpm run build
|
||||
pnpm --filter mtp-web-client run build
|
||||
|
||||
test:
|
||||
name: test
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command bash -lc 'cargo test --workspace --exclude mtp-wasm --all-features'
|
||||
|
||||
wasm:
|
||||
name: wasm build
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Build wasm crate
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command bash -lc 'cargo build -p mtp-wasm --target wasm32-unknown-unknown'
|
||||
env:
|
||||
RUSTFLAGS: --cfg web_sys_unstable_apis
|
||||
|
||||
example:
|
||||
name: example
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Check example usage workspace
|
||||
working-directory: example
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop .. --command bash -lc 'export MTP_TYPE_MAPS="$PWD/type-maps.yaml"; cargo check --workspace --all-targets --all-features'
|
||||
|
||||
deny:
|
||||
name: cargo-deny
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Run cargo-deny
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command cargo deny check advisories bans sources
|
||||
|
||||
machete:
|
||||
name: cargo-machete
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Run cargo-machete
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command mtp-machete
|
||||
|
||||
duplicates:
|
||||
name: duplicate code
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run duplicate detector
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command pnpm run dup
|
||||
|
||||
web-client:
|
||||
name: web client
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl xz-utils
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||
|
||||
- name: Build wasm package
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command wasm-pack build wasm --target web
|
||||
env:
|
||||
RUSTFLAGS: --cfg web_sys_unstable_apis
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build TypeScript package
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command pnpm run build
|
||||
env:
|
||||
RUSTFLAGS: --cfg web_sys_unstable_apis
|
||||
|
||||
- name: Build web client
|
||||
run: |
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
nix develop --command pnpm --filter mtp-web-client run build
|
||||
(
|
||||
cd example
|
||||
export MTP_TYPE_MAPS="$PWD/type-maps.yaml"
|
||||
cargo check --workspace --all-targets --all-features
|
||||
)
|
||||
'
|
||||
|
|
|
|||
Loading…
Reference in a new issue