2023-02-20 15:12:24 +03:00
|
|
|
name: "Test"
|
2024-02-07 01:12:43 +03:00
|
|
|
on:
|
2024-03-26 01:09:51 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
2023-02-20 15:12:24 +03:00
|
|
|
|
2024-02-08 18:50:10 +03:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
|
|
|
|
2023-02-20 15:12:24 +03:00
|
|
|
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 }}
|
2024-01-19 03:47:19 +03:00
|
|
|
rust: ${{ steps.filter.outputs.rust }}
|
2024-03-31 00:46:27 +03:00
|
|
|
gitbutler-core: ${{ steps.filter.outputs.gitbutler-core }}
|
2024-04-04 12:56:56 +03:00
|
|
|
gitbutler-tauri: ${{ steps.filter.outputs.gitbutler-tauri }}
|
2024-02-26 18:28:25 +03:00
|
|
|
gitbutler-changeset: ${{ steps.filter.outputs.gitbutler-changeset }}
|
2024-03-19 10:25:57 +03:00
|
|
|
gitbutler-git: ${{ steps.filter.outputs.gitbutler-git }}
|
2023-09-14 10:16:00 +03:00
|
|
|
steps:
|
2023-09-14 10:21:20 +03:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-29 18:23:08 +03:00
|
|
|
- uses: dorny/paths-filter@v3
|
2023-09-14 10:16:00 +03:00
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
2024-04-18 16:03:13 +03:00
|
|
|
workflows: &workflows
|
|
|
|
- '.github/workflows/**'
|
|
|
|
- '.github/actions/**'
|
2024-01-19 03:47:19 +03:00
|
|
|
node:
|
2024-04-18 16:03:13 +03:00
|
|
|
- *workflows
|
2024-04-04 12:56:56 +03:00
|
|
|
- 'app/**'
|
2024-01-19 03:47:19 +03:00
|
|
|
- 'package.json'
|
|
|
|
- 'pnpm-lock.yaml'
|
2024-01-19 19:50:52 +03:00
|
|
|
common-rust: &rust
|
2024-04-18 16:03:13 +03:00
|
|
|
- *workflows
|
2024-01-19 03:47:19 +03:00
|
|
|
- 'Cargo.lock'
|
|
|
|
- 'Cargo.toml'
|
|
|
|
- 'rust-toolchain.toml'
|
2024-01-19 19:50:52 +03:00
|
|
|
rust: &any-rust
|
|
|
|
- *rust
|
2024-03-31 02:21:13 +03:00
|
|
|
- 'crates/**'
|
2024-04-04 12:56:56 +03:00
|
|
|
gitbutler-tauri:
|
2024-01-19 19:50:52 +03:00
|
|
|
- *any-rust
|
2024-03-31 00:46:27 +03:00
|
|
|
gitbutler-core:
|
2024-03-30 13:19:07 +03:00
|
|
|
- *rust
|
2024-03-31 00:46:27 +03:00
|
|
|
- 'crates/gitbutler-core/**'
|
2024-02-26 18:28:25 +03:00
|
|
|
gitbutler-changeset:
|
2024-01-19 19:50:52 +03:00
|
|
|
- *rust
|
2024-04-04 12:56:56 +03:00
|
|
|
- 'crates/gitbutler-changeset/**'
|
2024-03-19 10:25:57 +03:00
|
|
|
gitbutler-git:
|
|
|
|
- *rust
|
2024-04-04 12:56:56 +03:00
|
|
|
- 'crates/gitbutler-git/**'
|
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
|
|
|
|
2024-05-02 13:52:44 +03:00
|
|
|
rust-lint:
|
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
|
2024-01-19 03:47:19 +03:00
|
|
|
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
|
2024-01-19 03:47:19 +03:00
|
|
|
- run: cargo fmt --check --all
|
2023-09-14 09:20:53 +03:00
|
|
|
|
2024-01-25 21:49:18 +03:00
|
|
|
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.
|
2024-03-19 10:25:57 +03:00
|
|
|
- run: cargo doc --no-deps --all-features --document-private-items -p gitbutler-changeset -p gitbutler-git
|
2024-01-25 21:49:18 +03:00
|
|
|
env:
|
|
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
|
|
|
2024-04-04 12:56:56 +03:00
|
|
|
check-gitbutler-tauri:
|
2024-05-02 13:52:44 +03:00
|
|
|
needs: changes
|
2024-04-04 12:56:56 +03:00
|
|
|
if: ${{ needs.changes.outputs.gitbutler-tauri == 'true' }}
|
2024-03-30 13:19:07 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
action:
|
|
|
|
- test
|
|
|
|
- check
|
|
|
|
- check-tests
|
|
|
|
features:
|
|
|
|
- ''
|
2024-04-16 17:43:22 +03:00
|
|
|
- [devtools]
|
2024-03-30 13:19:07 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-05-02 13:52:44 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
2024-03-30 13:19:07 +03:00
|
|
|
- uses: ./.github/actions/check-crate
|
|
|
|
with:
|
2024-04-04 12:56:56 +03:00
|
|
|
crate: gitbutler-tauri
|
2024-03-30 13:19:07 +03:00
|
|
|
features: ${{ toJson(matrix.features) }}
|
|
|
|
action: ${{ matrix.action }}
|
|
|
|
|
2024-04-04 12:56:56 +03:00
|
|
|
check-gitbutler-changeset:
|
2024-05-02 13:52:44 +03:00
|
|
|
needs: changes
|
2024-04-04 12:56:56 +03:00
|
|
|
if: ${{ needs.changes.outputs.gitbutler-changeset == 'true' }}
|
2023-09-14 09:20:53 +03:00
|
|
|
runs-on: ubuntu-latest
|
2024-01-19 03:47:19 +03:00
|
|
|
container:
|
|
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
action:
|
|
|
|
- test
|
|
|
|
- check
|
|
|
|
- check-tests
|
|
|
|
features:
|
|
|
|
- ''
|
2024-04-04 12:56:56 +03:00
|
|
|
- '*'
|
|
|
|
- []
|
2023-09-14 09:20:53 +03:00
|
|
|
steps:
|
2023-09-14 09:56:12 +03:00
|
|
|
- uses: actions/checkout@v4
|
2024-05-02 13:52:44 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
2024-01-19 03:47:19 +03:00
|
|
|
- uses: ./.github/actions/check-crate
|
|
|
|
with:
|
2024-04-04 12:56:56 +03:00
|
|
|
crate: gitbutler-changeset
|
2024-01-19 03:47:19 +03:00
|
|
|
features: ${{ toJson(matrix.features) }}
|
|
|
|
action: ${{ matrix.action }}
|
2023-10-18 13:52:37 +03:00
|
|
|
|
2024-04-04 12:56:56 +03:00
|
|
|
check-gitbutler-git:
|
2024-05-02 13:52:44 +03:00
|
|
|
needs: changes
|
2024-04-04 12:56:56 +03:00
|
|
|
if: ${{ needs.changes.outputs.gitbutler-git == 'true' }}
|
2024-01-19 03:47:19 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
action:
|
|
|
|
- test
|
|
|
|
- check
|
|
|
|
features:
|
|
|
|
- ''
|
|
|
|
- '*'
|
|
|
|
- []
|
2024-04-04 12:56:56 +03:00
|
|
|
- [tokio]
|
2024-01-19 03:47:19 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-05-02 13:52:44 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
2024-01-19 03:47:19 +03:00
|
|
|
- uses: ./.github/actions/check-crate
|
|
|
|
with:
|
2024-04-04 12:56:56 +03:00
|
|
|
crate: gitbutler-git
|
2024-01-19 03:47:19 +03:00
|
|
|
features: ${{ toJson(matrix.features) }}
|
|
|
|
action: ${{ matrix.action }}
|
|
|
|
|
2024-04-04 12:56:56 +03:00
|
|
|
check-gitbutler-core:
|
2024-05-02 13:52:44 +03:00
|
|
|
needs: changes
|
2024-04-04 12:56:56 +03:00
|
|
|
if: ${{ needs.changes.outputs.gitbutler-core == 'true' }}
|
2024-03-19 10:25:57 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
action:
|
|
|
|
- test
|
|
|
|
- check
|
|
|
|
features:
|
|
|
|
- ''
|
|
|
|
- '*'
|
|
|
|
- []
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-05-02 13:52:44 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
2024-03-19 10:25:57 +03:00
|
|
|
- uses: ./.github/actions/check-crate
|
|
|
|
with:
|
2024-04-18 15:54:08 +03:00
|
|
|
crate: gitbutler-core
|
2024-03-19 10:25:57 +03:00
|
|
|
features: ${{ toJson(matrix.features) }}
|
|
|
|
action: ${{ matrix.action }}
|
|
|
|
|
2024-01-19 03:47:19 +03:00
|
|
|
check-rust:
|
2024-03-10 00:20:30 +03:00
|
|
|
if: always()
|
2024-01-19 03:47:19 +03:00
|
|
|
needs:
|
|
|
|
- changes
|
2024-04-04 12:56:56 +03:00
|
|
|
- check-gitbutler-tauri
|
|
|
|
- check-gitbutler-core
|
2024-02-26 18:28:25 +03:00
|
|
|
- check-gitbutler-changeset
|
2024-03-19 10:25:57 +03:00
|
|
|
- check-gitbutler-git
|
2024-04-18 15:04:52 +03:00
|
|
|
- check-rust-windows
|
2024-05-02 13:52:44 +03:00
|
|
|
- rust-lint
|
2024-01-19 03:47:19 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-03-18 17:06:40 +03:00
|
|
|
- name: Decide whether the needed jobs succeeded or failed
|
2024-03-10 00:20:30 +03:00
|
|
|
uses: re-actors/alls-green@release/v1
|
|
|
|
with:
|
2024-03-18 18:56:03 +03:00
|
|
|
allowed-skips: ${{ toJSON(needs) }}
|
2024-03-10 00:20:30 +03:00
|
|
|
jobs: ${{ toJSON(needs) }}
|
|
|
|
|
2024-04-18 15:04:52 +03:00
|
|
|
check-rust-windows:
|
|
|
|
needs: changes
|
|
|
|
runs-on: windows-latest
|
|
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-05-02 14:03:29 +03:00
|
|
|
- uses: ./.github/actions/init-env-rust
|
2024-04-18 15:04:52 +03:00
|
|
|
- name: "cargo check"
|
2024-04-25 12:17:52 +03:00
|
|
|
run: cargo check --all --bins --examples --features windows
|