cicd: new workflow
This commit is contained in:
parent
1b1c3974f7
commit
cc4f932d17
14 changed files with 611 additions and 228 deletions
69
.github/workflows/CICD.yml
vendored
Normal file
69
.github/workflows/CICD.yml
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
name: CICD
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- check/*
|
||||
|
||||
concurrency:
|
||||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
init:
|
||||
name: Init
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get PR head ref
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
id: ref
|
||||
run: |
|
||||
echo "ref=refs/pull/${{ github.event.pull_request.number }}/head" >> $GITHUB_OUTPUT
|
||||
outputs:
|
||||
ref: >-
|
||||
${{
|
||||
(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/v'))
|
||||
&& steps.ref.outputs.ref
|
||||
|| github.ref
|
||||
}}
|
||||
|
||||
fast_checks:
|
||||
name: Fast checks
|
||||
uses: ./.github/workflows/fast_checks.yml
|
||||
|
||||
full_checks:
|
||||
name: Full Rust checks
|
||||
needs: fast_checks
|
||||
uses: ./.github/workflows/full_rust_checks.yml
|
||||
|
||||
min_version:
|
||||
name: Minimum supported rust version
|
||||
needs: fast_checks
|
||||
uses: ./.github/workflows/msrv.yml
|
||||
with:
|
||||
package: tree-sitter-cli
|
||||
|
||||
build:
|
||||
name: Build & Test
|
||||
needs: [init, fast_checks]
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
ref: ${{ needs.init.outputs.ref }}
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: [init, fast_checks, full_checks, min_version, build]
|
||||
if: >
|
||||
github.event.pull_request.head.repo.full_name == github.repository &&
|
||||
startsWith(github.head_ref, 'release/v')
|
||||
uses: ./.github/workflows/release.yml
|
||||
with:
|
||||
ref: ${{ needs.init.outputs.ref }}
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
needs: release
|
||||
uses: ./.github/workflows/publish.yml
|
||||
Loading…
Add table
Add a link
Reference in a new issue