mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 01:17:37 +03:00
ad3e15dae4
Instead, use it only where needed, which at this time is Windows for some nightly-only access to file-descriptors.
146 lines
3.9 KiB
YAML
146 lines
3.9 KiB
YAML
name: "Test"
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
node: ${{ steps.filter.outputs.node }}
|
|
rust: ${{ steps.filter.outputs.rust }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
workflows: &workflows
|
|
- '.github/workflows/**'
|
|
- '.github/actions/**'
|
|
node:
|
|
- *workflows
|
|
- 'apps/desktop/**'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
common-rust: &rust
|
|
- *workflows
|
|
- 'Cargo.lock'
|
|
- 'Cargo.toml'
|
|
rust: &any-rust
|
|
- *rust
|
|
- 'crates/**'
|
|
|
|
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-lint:
|
|
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
|
|
|
|
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-git
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
|
|
rust-test:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/gitbutlerapp/ci-base-image:latest
|
|
strategy:
|
|
matrix:
|
|
# Specifies which features should be applied when running the checks and tests
|
|
# '' indicates no flags relating to features passed
|
|
# [] indicates --no-default-features flag passed
|
|
# '*' indicates --all-features passed
|
|
# [entry1, entry2] indicates --features entry1 entry2
|
|
features:
|
|
- ''
|
|
- '*'
|
|
- []
|
|
- [tokio]
|
|
- [devtools]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/check-crate
|
|
with:
|
|
features: ${{ toJson(matrix.features) }}
|
|
|
|
check-rust:
|
|
if: always()
|
|
needs:
|
|
- changes
|
|
- check-rust-windows
|
|
- rust-test
|
|
- rust-lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
uses: re-actors/alls-green@release/v1
|
|
with:
|
|
allowed-skips: ${{ toJSON(needs) }}
|
|
jobs: ${{ toJSON(needs) }}
|
|
|
|
check-rust-windows:
|
|
needs: changes
|
|
runs-on: windows-latest
|
|
if: ${{ needs.changes.outputs.rust == 'true' }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/init-env-rust
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2.7.3
|
|
with:
|
|
shared-key: windows-rust-testing
|
|
key: ${{ inputs.features }}
|
|
- name: "cargo check"
|
|
run: cargo check --workspace --bins --examples --features windows
|