Skip to content

Commit 795436a

Browse files
committed
ci: format yml files and add all-green step for branch protection
1 parent 5836696 commit 795436a

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# copy from: https://github.com/frankie567/httpx-ws/blob/main/.github/workflows/docs.yml
22

3-
name: Deploy documentation
3+
# WARNING: Do not change the name of this file, keep `docs.yml`.
4+
# markdown badges are hard-coded to point to this file.
45

6+
name: Deploy documentation
57

68
# Since document updates may be frequent,
79
# we do not run tests when deploying documents,

.github/workflows/lint-test.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# WARNING: Do not change the name of this file, keep `lint-test.yml`.
2+
# `workflow_call` needs the name of the workflow file to work.
23

34
name: Lint check and test
45

5-
66
# We only automatically run checks for PRs.
77
# It is best to avoid direct commits to the main branch, instead make a PR for checks.
88
# For the pushes to the main branch, the checks is done by `publish.yml` when publish.
@@ -12,7 +12,6 @@ on:
1212
# NOTE: set `secrets: inherit` when call this workflow from other workflow.
1313
workflow_call:
1414

15-
1615
jobs:
1716
lint-check:
1817
runs-on: ubuntu-latest
@@ -63,3 +62,16 @@ jobs:
6362
token: ${{ secrets.CODECOV_TOKEN }}
6463
verbose: true
6564
fail_ci_if_error: true
65+
66+
# https://github.com/marketplace/actions/alls-green#why
67+
lint-test-all-green: # This job does nothing and is only used for the branch protection
68+
if: always() # IMPORTANT: mandatory
69+
needs:
70+
- lint-check
71+
- test
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Decide whether the needed jobs succeeded or failed
75+
uses: re-actors/alls-green@release/v1
76+
with:
77+
jobs: ${{ toJSON(needs) }}

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# refer to: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
22

3-
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
3+
# WARNING: Do not change the name of this file, keep `publish.yml`.
4+
# "trusted publishing" will check the name of the workflow file.
5+
6+
name: Publish Python 🐍 distribution 📦 to PyPI
47

5-
# NOTE: We do not restrict branches here,
6-
# instead restrict branches in the `environment` - `pypi`.
78
on:
89
push:
910
tags:

0 commit comments

Comments
 (0)