mirror of
https://github.com/renovatebot/pre-commit-hooks.git
synced 2026-04-13 10:14:17 +00:00
test: test before tagging
This commit is contained in:
parent
2f7b6234a8
commit
ac099cfea7
2 changed files with 30 additions and 21 deletions
|
|
@ -1,12 +1,40 @@
|
||||||
name: tag
|
name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
timeout-minutes: 10
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3.0.0
|
||||||
|
with:
|
||||||
|
cache: pip
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Run pre-commit
|
||||||
|
run: >-
|
||||||
|
pre-commit try-repo --all-files
|
||||||
|
--ref="${GITHUB_SHA}"
|
||||||
|
"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
@ -34,23 +62,3 @@ jobs:
|
||||||
if ! git show-ref --tags "${TAG}" --quiet; then
|
if ! git show-ref --tags "${TAG}" --quiet; then
|
||||||
git tag "${TAG}" && git push origin "${TAG}"
|
git tag "${TAG}" && git push origin "${TAG}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test:
|
|
||||||
needs: [tag]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3.0.0
|
|
||||||
|
|
||||||
- name: Run pre-commit
|
|
||||||
uses: pre-commit/action@9b88afc9cd57fd75b655d5c71bd38146d07135fe # renovate: tag=v2.0.3
|
|
||||||
with:
|
|
||||||
extra_args: --all-files
|
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pre-commit==2.17.0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue