mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-30 04:58:55 +03:00
219 lines
5.8 KiB
YAML
219 lines
5.8 KiB
YAML
name: "Test"
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
node: ${{ steps.filter.outputs.node }}
|
|
rust: ${{ steps.filter.outputs.rust }}
|
|
gitbutler-app: ${{ steps.filter.outputs.gitbutler-app }}
|
|
gitbutler-core: ${{ steps.filter.outputs.gitbutler-core }}
|
|
gitbutler-git: ${{ steps.filter.outputs.gitbutler-git }}
|
|
gitbutler-diff: ${{ steps.filter.outputs.gitbutler-diff }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
node:
|
|
- 'gitbutler-ui/**'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
common-rust: &rust
|
|
- 'Cargo.lock'
|
|
- 'Cargo.toml'
|
|
- 'rust-toolchain.toml'
|
|
rust: &any-rust
|
|
- *rust
|
|
- 'gitbutler-!(ui)/**'
|
|
gitbutler-app:
|
|
- *any-rust
|
|
gitbutler-core:
|
|
- *rust
|
|
- 'gitbutler-core/**'
|
|
gitbutler-git:
|
|
- *rust
|
|
- 'gitbutler-git/**'
|
|
gitbutler-diff:
|
|
- *rust
|
|
- 'gitbutler-diff/**'
|
|
|
|
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
|
|
|
|
rust-init:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-rust
|
|
- run: cargo fmt --check --all
|
|
- run: cargo build --locked --all-targets --tests
|
|
|
|
rust-docs:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/init-env-rust
|
|
# TODO(qix-): we have to exclude the app here for now because for some
|
|
# TODO(qix-): reason it doesn't build with the docs feature enabled.
|
|
- run: cargo doc --no-deps --all-features --document-private-items -p gitbutler-core -p gitbutler-git -p gitbutler-diff
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
|
|
check-gitbutler-app:
|
|
needs: [changes, rust-init]
|
|
if: ${{ needs.changes.outputs.gitbutler-app == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
strategy:
|
|
matrix:
|
|
action:
|
|
- test
|
|
- check
|
|
- check-tests
|
|
features:
|
|
- ''
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/check-crate
|
|
with:
|
|
crate: gitbutler-app
|
|
features: ${{ toJson(matrix.features) }}
|
|
action: ${{ matrix.action }}
|
|
|
|
check-gitbutler-git:
|
|
needs: [changes, rust-init]
|
|
if: ${{ needs.changes.outputs.gitbutler-git == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
strategy:
|
|
matrix:
|
|
action:
|
|
- test
|
|
- check
|
|
- check-tests
|
|
features:
|
|
- ''
|
|
- '*'
|
|
- []
|
|
- [cli]
|
|
- [cli, tokio]
|
|
- [serde]
|
|
- [git2]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# FIXME(qix-): figure out a way to make these build automatically with tests
|
|
- run: cargo build --locked -p gitbutler-git --bin gitbutler-git-askpass --bin gitbutler-git-setsid
|
|
- uses: ./.github/actions/check-crate
|
|
with:
|
|
crate: gitbutler-git
|
|
features: ${{ toJson(matrix.features) }}
|
|
action: ${{ matrix.action }}
|
|
|
|
check-gitbutler-diff:
|
|
needs: [changes, rust-init]
|
|
if: ${{ needs.changes.outputs.gitbutler-diff == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
strategy:
|
|
matrix:
|
|
action:
|
|
- test
|
|
- check
|
|
- check-tests
|
|
features:
|
|
- ''
|
|
- '*'
|
|
- []
|
|
- [git2]
|
|
- [mmap]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/check-crate
|
|
with:
|
|
crate: gitbutler-diff
|
|
features: ${{ toJson(matrix.features) }}
|
|
action: ${{ matrix.action }}
|
|
|
|
check-gitbutler-core:
|
|
needs: [changes, rust-init]
|
|
if: ${{ needs.changes.outputs.gitbutler-core == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
strategy:
|
|
matrix:
|
|
action:
|
|
- test
|
|
- check
|
|
- check-tests
|
|
features:
|
|
- ''
|
|
- '*'
|
|
- []
|
|
- [serde]
|
|
- [rusqlite]
|
|
- [serde, rusqlite]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/check-crate
|
|
with:
|
|
crate: gitbutler-core
|
|
features: ${{ toJson(matrix.features) }}
|
|
action: ${{ matrix.action }}
|
|
|
|
check-rust:
|
|
needs:
|
|
- changes
|
|
- check-gitbutler-app
|
|
- check-gitbutler-git
|
|
- check-gitbutler-diff
|
|
- check-gitbutler-core
|
|
runs-on: ubuntu-latest
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
steps:
|
|
- run: ':'
|
|
shell: bash
|