mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-07 10:26:45 +03:00
c5f5dc015f
also * remove unused `sentry-rust-minidump` * use maintained rust toolchain github action * make `init-env-rust` parameterized to allow picking `nightly`
99 lines
2.5 KiB
YAML
99 lines
2.5 KiB
YAML
name: "Test"
|
|
on: [push]
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
rust: ${{ steps.filter.outputs.rust }}
|
|
node: ${{ steps.filter.outputs.node }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
rust:
|
|
- 'packages/tauri/**'
|
|
- 'packages/butler/**'
|
|
- 'Cargo.lock'
|
|
- 'Cargo.toml'
|
|
node:
|
|
- 'packages/ui/**'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
|
|
lint-node:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-node
|
|
- run: pnpm lint
|
|
|
|
check-node:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-node
|
|
- run: pnpm check
|
|
|
|
unittest-node:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-node
|
|
- run: pnpm test
|
|
|
|
lint-rust:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-rust
|
|
- run: cargo fmt --check
|
|
- run: cargo install cargo-sort
|
|
- run: cargo sort --check --workspace
|
|
|
|
story:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-node
|
|
- run: pnpm story:build
|
|
|
|
test:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-rust
|
|
- uses: ./.github/actions/init-env-node
|
|
- run: pnpm build
|
|
- run: cargo clippy --all-features --tests
|
|
- run: cargo test --locked
|
|
|
|
udeps:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-node
|
|
- uses: ./.github/actions/init-env-rust
|
|
with:
|
|
rust: "nightly"
|
|
- name: Install cargo udeps
|
|
run: cargo install cargo-udeps --locked
|
|
- run: pnpm build
|
|
- run: cargo +nightly udeps --all-targets
|