gitbutler/.github/workflows/push.yaml

206 lines
5.3 KiB
YAML
Raw Normal View History

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
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 }}
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: |
node:
- 'gitbutler-ui/**'
- 'package.json'
- 'pnpm-lock.yaml'
2023-09-14 10:30:38 +03:00
rust:
- 'gitbutler-*/**'
- '!gitbutler-ui/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
gitbutler-app:
- 'gitbutler-*/**'
- '!gitbutler-ui/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
gitbutler-core:
2023-12-28 17:23:15 +03:00
- 'gitbutler-core/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
gitbutler-git:
2024-01-18 19:22:50 +03:00
- 'gitbutler-git/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
gitbutler-diff:
2024-01-18 19:22:50 +03:00
- 'gitbutler-diff/**'
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:16:00 +03:00
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
rust-init:
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
container:
image: ghcr.io/gitbutlerapp/ci-base-image:latest
2023-09-14 10:16:00 +03:00
steps:
- uses: actions/checkout@v4
2023-09-14 10:30:38 +03:00
- uses: ./.github/actions/init-env-rust
- run: cargo fmt --check --all
- run: cargo build --locked --all-targets --tests
2023-09-14 09:20:53 +03:00
check-gitbutler-app:
needs: [changes, rust-init]
if: ${{ needs.changes.outputs.gitbutler-app == 'true' }}
2023-09-14 09:20:53 +03:00
runs-on: ubuntu-latest
container:
image: ghcr.io/gitbutlerapp/ci-base-image:latest
strategy:
matrix:
action:
- test
- check
- check-tests
features:
- ''
2023-09-14 09:20:53 +03:00
steps:
2023-09-14 09:56:12 +03:00
- 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
- 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