mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
ci: redesign CI-related workflows to allow marking them as "Required” before merging a PR (#368)
This commit is contained in:
committed by
GitHub
parent
7632e6a464
commit
96deea7f31
@@ -4,20 +4,20 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
# match
|
||||||
|
# - all files inside `apps/documentation` and `.github`
|
||||||
|
# - all files in the root expect `Cargo.toml`
|
||||||
paths:
|
paths:
|
||||||
# ⬇ Keep paths in sync with `typescript.yml`
|
|
||||||
- '.github/**'
|
- '.github/**'
|
||||||
- '*'
|
- '*'
|
||||||
- '!Cargo.toml'
|
- '!Cargo.toml'
|
||||||
# ⬆ Keep paths in sync with `typescript.yml`
|
|
||||||
- 'apps/documentation/**'
|
- 'apps/documentation/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
# same as `on.push.paths`
|
||||||
paths:
|
paths:
|
||||||
# ⬇ Keep paths in sync with `typescript.yml`
|
|
||||||
- '.github/**'
|
- '.github/**'
|
||||||
- '*'
|
- '*'
|
||||||
- '!Cargo.toml'
|
- '!Cargo.toml'
|
||||||
# ⬆ Keep paths in sync with `typescript.yml`
|
|
||||||
- 'apps/documentation/**'
|
- 'apps/documentation/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -8,18 +8,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
paths:
|
|
||||||
- '*'
|
|
||||||
- '.github/**'
|
|
||||||
- '.docker/**'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- '*'
|
|
||||||
- '.github/**'
|
|
||||||
- '.docker/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
format:
|
||||||
name: Check format
|
name: Check format
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
@@ -33,3 +25,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Test project
|
- name: Test project
|
||||||
run: pnpm repo:root:format:check
|
run: pnpm repo:root:format:check
|
||||||
|
|
||||||
|
ci_ok:
|
||||||
|
name: OK
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 1
|
||||||
|
if: always()
|
||||||
|
needs: [format]
|
||||||
|
env:
|
||||||
|
FAILURE: ${{ contains(join(needs.*.result, ','), 'failure') }}
|
||||||
|
CANCELLED: ${{ contains(join(needs.*.result, ','), 'cancelled') }}
|
||||||
|
steps:
|
||||||
|
- name: Check for failure or cancelled jobs result
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Failure: $FAILURE - Cancelled: $CANCELLED"
|
||||||
|
if [ "$FAILURE" = "false" ] && [ "$CANCELLED" = "false" ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -4,15 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
paths:
|
|
||||||
- '.github/**'
|
|
||||||
- 'Cargo.toml'
|
|
||||||
- 'crates/**'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- '.github/**'
|
|
||||||
- 'Cargo.toml'
|
|
||||||
- 'crates/**'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
@@ -40,6 +32,7 @@ jobs:
|
|||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -56,6 +49,7 @@ jobs:
|
|||||||
lint_and_fmt:
|
lint_and_fmt:
|
||||||
name: Check format and lint rust crates
|
name: Check format and lint rust crates
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -66,3 +60,23 @@ jobs:
|
|||||||
|
|
||||||
- run: cargo fmt --all -- --check
|
- run: cargo fmt --all -- --check
|
||||||
- run: cargo clippy -- -D warnings
|
- run: cargo clippy -- -D warnings
|
||||||
|
|
||||||
|
ci_ok:
|
||||||
|
name: OK
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 1
|
||||||
|
if: always()
|
||||||
|
needs: [build_and_test, lint_and_fmt]
|
||||||
|
env:
|
||||||
|
FAILURE: ${{ contains(join(needs.*.result, ','), 'failure') }}
|
||||||
|
CANCELLED: ${{ contains(join(needs.*.result, ','), 'cancelled') }}
|
||||||
|
steps:
|
||||||
|
- name: Check for failure or cancelled jobs result
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Failure: $FAILURE - Cancelled: $CANCELLED"
|
||||||
|
if [ "$FAILURE" = "false" ] && [ "$CANCELLED" = "false" ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -4,26 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
paths:
|
|
||||||
# ⬇ Keep paths in sync with `ci-documentation.yml`
|
|
||||||
- '.github/**'
|
|
||||||
- '*'
|
|
||||||
- '!Cargo.toml'
|
|
||||||
# ⬆ Keep paths in sync with `ci-documentation.yml`
|
|
||||||
- 'packages/**'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
# ⬇ Keep paths in sync with `ci-documentation.yml`
|
|
||||||
- '.github/**'
|
|
||||||
- '*'
|
|
||||||
- '!Cargo.toml'
|
|
||||||
# ⬆ Keep paths in sync with `ci-documentation.yml`
|
|
||||||
- 'packages/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
name: Check build and test
|
name: Check build and test
|
||||||
timeout-minutes: 15
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@@ -34,6 +19,7 @@ jobs:
|
|||||||
- 'windows-latest'
|
- 'windows-latest'
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -68,3 +54,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Types
|
- name: Types
|
||||||
run: pnpm types
|
run: pnpm types
|
||||||
|
|
||||||
|
ci_ok:
|
||||||
|
name: OK
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 1
|
||||||
|
if: always()
|
||||||
|
needs: [build_and_test, lint_and_fmt]
|
||||||
|
env:
|
||||||
|
FAILURE: ${{ contains(join(needs.*.result, ','), 'failure') }}
|
||||||
|
CANCELLED: ${{ contains(join(needs.*.result, ','), 'cancelled') }}
|
||||||
|
steps:
|
||||||
|
- name: Check for failure or cancelled jobs result
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Failure: $FAILURE - Cancelled: $CANCELLED"
|
||||||
|
if [ "$FAILURE" = "false" ] && [ "$CANCELLED" = "false" ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user