This commit is contained in:
parent
88f8f93d89
commit
a53c45aefe
1 changed files with 22 additions and 156 deletions
|
|
@ -7,12 +7,11 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
NIX_CONFIG: experimental-features = nix-command flakes
|
NIX_CONFIG: experimental-features = nix-command flakes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fmt:
|
checks:
|
||||||
name: rustfmt
|
name: checks
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- 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
|
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
|
curl -L https://nixos.org/nix/install | sh -s -- --daemon
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Run checks
|
||||||
run: |
|
run: |
|
||||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
. /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:
|
cargo fmt --all --check
|
||||||
name: clippy
|
cargo clippy --workspace --exclude mtp-wasm --all-targets --all-features -- -D warnings -W unreachable-pub
|
||||||
runs-on: docker
|
cargo test --workspace --exclude mtp-wasm --all-features
|
||||||
steps:
|
RUSTFLAGS="--cfg web_sys_unstable_apis" cargo build -p mtp-wasm --target wasm32-unknown-unknown
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
cargo deny check advisories bans sources
|
||||||
|
cargo machete
|
||||||
|
|
||||||
- name: Install Nix
|
pnpm install --frozen-lockfile
|
||||||
run: |
|
pnpm run dup
|
||||||
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 clippy
|
RUSTFLAGS="--cfg web_sys_unstable_apis" wasm-pack build wasm --target web
|
||||||
run: |
|
RUSTFLAGS="--cfg web_sys_unstable_apis" pnpm run build
|
||||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
pnpm --filter mtp-web-client run build
|
||||||
nix develop --command mtp-clippy
|
|
||||||
|
|
||||||
test:
|
(
|
||||||
name: test
|
cd example
|
||||||
runs-on: docker
|
export MTP_TYPE_MAPS="$PWD/type-maps.yaml"
|
||||||
steps:
|
cargo check --workspace --all-targets --all-features
|
||||||
- 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
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue