gitbutler/.github/workflows/push.yaml
2023-12-28 15:23:15 +01:00

82 lines
2.1 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:
- 'gitbutler-app/**'
- 'gitbutler-core/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
node:
- 'gitbutler-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
test-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 test --locked
check-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 clippy --all-targets --all-features --tests