Unverified Commit 8d9779b2 authored by Yue Yang's avatar Yue Yang Committed by GitHub
Browse files

ci: handling skipped but required checks (#2758)


* ci: handling skipped but required checks
Signed-off-by: default avatarYue Yang <g1enyy0ung@gmail.com>

* fix: ui paths
Signed-off-by: default avatarYue Yang <g1enyy0ung@gmail.com>

* chore: delete ci_skip

It seems that the skipped status can be successfully reported without ci_skip.
Signed-off-by: default avatarYue Yang <g1enyy0ung@gmail.com>

* chore: re-add ci_skip
Signed-off-by: default avatarYue Yang <g1enyy0ung@gmail.com>

* chore: remove node-version matrix
Signed-off-by: default avatarYue Yang <g1enyy0ung@gmail.com>

* fix: needs name
Signed-off-by: default avatarYue Yang <g1enyy0ung@gmail.com>
Showing with 67 additions and 9 deletions
+67 -9
# This workflow defines the go and ui related jobs.
#
# We will use the `job` matrix variable to run each subjob. Currently we have:
# First, we use [dorny/paths-filter@v2](https://github.com/dorny/paths-filter) to
# detect changes in go and ui related files, and then run the corresponding sub-jobs
# based on the changes.
#
# - verify
# - build
# - test
# Please note that due to the GitHub required checks, the `go` and `ui` jobs are
# also need to run to report the status. So here we need to define an additional
# "skip" file to ensure that the status is reported. For details, please refer to:
#
# - `ci_skip.yml`
# - https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
name: ci
on:
......@@ -32,9 +37,10 @@ jobs:
- go.*
- '**.go'
ui:
- 'ui/**'
- '!ui/README.md'
- '!ui/.*'
- 'ui/yarn.lock'
- '**.js'
- '**.ts'
- '**.tsx'
go:
needs: changes
if: ${{ needs.changes.outputs.go == 'true' }}
......@@ -100,12 +106,12 @@ jobs:
job:
- build
- test
node-version: ["14"] # TODO: add nodejs-16?
# node-version: ["14"] # TODO: add nodejs-16?
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: 14
cache: "yarn"
cache-dependency-path: "ui/yarn.lock"
......
# Please refer to the file comments in `ci.yml` for more information.
name: ci
on:
pull_request:
branches:
- master
- release-*
jobs:
skip-changes:
runs-on: ubuntu-latest
outputs:
go: ${{ steps.filter.outputs.go }}
ui: ${{ steps.filter.outputs.ui }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
go:
- Makefile
- go.*
- '**.go'
ui:
- 'ui/yarn.lock'
- '**.js'
- '**.ts'
- '**.tsx'
go:
needs: skip-changes
if: ${{ needs.skip-changes.outputs.go != 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
job:
- verify
- build
- test
steps:
- run: echo "Not required"
ui:
needs: skip-changes
if: ${{ needs.skip-changes.outputs.ui != 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
job:
- build
- test
steps:
- run: echo "Not required"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment