2023-02-20 15:12:24 +03:00
|
|
|
name: "Test"
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2023-09-14 10:16:00 +03:00
|
|
|
changes:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2023-09-14 10:30:38 +03:00
|
|
|
rust: ${{ steps.filter.outputs.rust }}
|
|
|
|
node: ${{ steps.filter.outputs.node }}
|
2023-09-14 10:16:00 +03:00
|
|
|
steps:
|
2023-09-14 10:21:20 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-14 10:16:00 +03:00
|
|
|
- uses: dorny/paths-filter@v2
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
2023-09-14 10:30:38 +03:00
|
|
|
rust:
|
2023-12-22 16:22:54 +03:00
|
|
|
- 'gitbutler-app/**'
|
2023-12-28 17:23:15 +03:00
|
|
|
- 'gitbutler-core/**'
|
2023-09-14 10:16:00 +03:00
|
|
|
- 'Cargo.lock'
|
|
|
|
- 'Cargo.toml'
|
2023-12-11 13:09:19 +03:00
|
|
|
- 'rust-toolchain.toml'
|
2023-09-14 10:30:38 +03:00
|
|
|
node:
|
2023-12-22 16:22:54 +03:00
|
|
|
- 'gitbutler-ui/**'
|
2023-09-14 10:16:00 +03:00
|
|
|
- 'package.json'
|
|
|
|
- 'pnpm-lock.yaml'
|
|
|
|
|
2023-09-14 10:30:38 +03:00
|
|
|
lint-node:
|
2023-09-14 10:16:00 +03:00
|
|
|
needs: changes
|
2023-09-14 10:30:38 +03:00
|
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
2023-09-14 09:20:53 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-14 09:56:12 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-14 10:30:38 +03:00
|
|
|
- uses: ./.github/actions/init-env-node
|
2023-09-14 09:54:23 +03:00
|
|
|
- run: pnpm lint
|
2023-09-14 09:20:53 +03:00
|
|
|
|
2023-09-14 10:30:38 +03:00
|
|
|
check-node:
|
2023-09-14 10:16:00 +03:00
|
|
|
needs: changes
|
2023-09-14 10:30:38 +03:00
|
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
2023-09-14 09:20:53 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-14 09:56:12 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-14 10:30:38 +03:00
|
|
|
- uses: ./.github/actions/init-env-node
|
2023-09-14 09:54:23 +03:00
|
|
|
- run: pnpm check
|
2023-09-14 09:20:53 +03:00
|
|
|
|
2023-09-14 10:30:38 +03:00
|
|
|
unittest-node:
|
2023-09-14 10:16:00 +03:00
|
|
|
needs: changes
|
2023-09-14 10:30:38 +03:00
|
|
|
if: ${{ needs.changes.outputs.node == 'true' }}
|
2023-09-14 09:20:53 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-14 09:56:12 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-14 10:30:38 +03:00
|
|
|
- uses: ./.github/actions/init-env-node
|
2023-09-14 09:54:23 +03:00
|
|
|
- run: pnpm test
|
2023-09-14 09:20:53 +03:00
|
|
|
|
2023-09-14 10:30:38 +03:00
|
|
|
lint-rust:
|
2023-09-14 10:16:00 +03:00
|
|
|
needs: changes
|
2023-09-14 10:30:38 +03:00
|
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
2023-09-14 10:16:00 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2023-09-14 10:30:38 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
|
|
|
- run: cargo fmt --check
|
2023-09-14 09:20:53 +03:00
|
|
|
|
2023-10-19 11:44:26 +03:00
|
|
|
test-rust:
|
2023-09-14 10:30:38 +03:00
|
|
|
needs: changes
|
|
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
2023-09-14 09:20:53 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-14 09:56:12 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-14 10:30:38 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
2023-09-14 09:54:23 +03:00
|
|
|
- run: cargo test --locked
|
2023-10-18 13:52:37 +03:00
|
|
|
|
2023-10-19 11:44:26 +03:00
|
|
|
check-rust:
|
2023-10-18 13:52:37 +03:00
|
|
|
needs: changes
|
|
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: ./.github/actions/init-env-rust
|
2023-11-24 11:03:04 +03:00
|
|
|
- run: cargo clippy --all-targets --all-features --tests
|