mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-22 14:38:03 +01:00
Separate pull request workflow from build publish & deploy
This commit is contained in:
parent
5b20019c18
commit
5d8a36efb0
4 changed files with 34 additions and 35 deletions
11
.github/workflows/codeql-analysis.yaml
vendored
11
.github/workflows/codeql-analysis.yaml
vendored
|
@ -1,14 +1,3 @@
|
||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL"
|
name: "CodeQL"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Build, publish & deploy
|
name: Test, build, publish & deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
33
.github/workflows/pull_request.yaml
vendored
Normal file
33
.github/workflows/pull_request.yaml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Test & auto merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
uses: ./.github/workflows/test.yaml
|
||||||
|
auto_merge:
|
||||||
|
name: Auto merge
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: tests
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
if: >-
|
||||||
|
github.event.pull_request
|
||||||
|
&& github.event.pull_request.merged == false
|
||||||
|
&& (
|
||||||
|
github.event.pull_request.user.login == 'crocmagnon-pr[bot]'
|
||||||
|
|| github.event.pull_request.user.login == 'pre-commit-ci[bot]'
|
||||||
|
)
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Auto merge
|
||||||
|
run: gh pr merge ${{github.event.pull_request.number}} --delete-branch --rebase
|
23
.github/workflows/test.yaml
vendored
23
.github/workflows/test.yaml
vendored
|
@ -3,8 +3,6 @@ name: Test
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -35,24 +33,3 @@ jobs:
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pytest --cov=. --cov-branch --cov-report term-missing:skip-covered
|
run: pytest --cov=. --cov-branch --cov-report term-missing:skip-covered
|
||||||
working-directory: ./src/
|
working-directory: ./src/
|
||||||
auto_merge:
|
|
||||||
name: Auto merge
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: tests
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
if: >-
|
|
||||||
github.event.pull_request
|
|
||||||
&& github.event.pull_request.merged == false
|
|
||||||
&& (
|
|
||||||
github.event.pull_request.user.login == 'crocmagnon-pr[bot]'
|
|
||||||
|| github.event.pull_request.user.login == 'pre-commit-ci[bot]'
|
|
||||||
)
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Auto merge
|
|
||||||
run: gh pr merge ${{github.event.pull_request.number}} --delete-branch --rebase
|
|
||||||
|
|
Loading…
Reference in a new issue