mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-25 18:00:28 +00:00
ci: Add linting of workflow and related pre-commit hook (#4032)
* Add actionlint pre-commit hook * Add workflow to lint workflows * Remove unused input in Python Cache action * Move from deprecated set-output syntax to new one * Add actionlint config to specify self-hosted runners labels
This commit is contained in:
parent
2878c57645
commit
e62d24d0eb
3
.github/actionlint.yml
vendored
Normal file
3
.github/actionlint.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
self-hosted-runner:
|
||||||
|
# Labels of self-hosted runner in array of string
|
||||||
|
labels: ["cml"]
|
3
.github/actions/python_cache/action.yml
vendored
3
.github/actions/python_cache/action.yml
vendored
@ -6,9 +6,6 @@ inputs:
|
|||||||
description: 'prefix for the cache (to distinguish OS)'
|
description: 'prefix for the cache (to distinguish OS)'
|
||||||
required: true
|
required: true
|
||||||
default: 'linux'
|
default: 'linux'
|
||||||
pythonPath:
|
|
||||||
description: 'Python path to cache/restore'
|
|
||||||
required: true
|
|
||||||
pythonVersion:
|
pythonVersion:
|
||||||
description: 'Python version to use'
|
description: 'Python version to use'
|
||||||
required: true
|
required: true
|
||||||
|
5
.github/workflows/minor_version_release.yml
vendored
5
.github/workflows/minor_version_release.yml
vendored
@ -7,7 +7,6 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
# We only need `major.minor` in Readme so we cut the full version string to the first two tokens
|
# We only need `major.minor` in Readme so we cut the full version string to the first two tokens
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=current_release_minor::$(cat VERSION.txt | cut -d "." -f 1,2)"
|
echo "current_release_minor=$(cat VERSION.txt | cut -d "." -f 1,2)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create new version branch
|
- name: Create new version branch
|
||||||
run: |
|
run: |
|
||||||
@ -31,7 +30,7 @@ jobs:
|
|||||||
- name: Bump version on main
|
- name: Bump version on main
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git checkout main
|
git checkout main
|
||||||
cat VERSION.txt | awk -F. '/[0-9]+\./{$2++;print}' OFS=. | tee VERSION.txt
|
cat VERSION.txt | awk -F. '/[0-9]+\./{$2++;print}' OFS=. | tee VERSION.txt
|
||||||
|
8
.github/workflows/readme_sync.yml
vendored
8
.github/workflows/readme_sync.yml
vendored
@ -6,21 +6,19 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
# release branches have the form v1.9.x
|
# release branches have the form v1.9.x
|
||||||
- 'v[0-9].*[0-9].x'
|
- "v[0-9].*[0-9].x"
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python 3.8.10
|
- name: Set up Python 3.8.10
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@ -34,7 +32,7 @@ jobs:
|
|||||||
id: current-version
|
id: current-version
|
||||||
shell: bash
|
shell: bash
|
||||||
# We only need `major.minor` in Readme so we cut the full version string to the first two tokens
|
# We only need `major.minor` in Readme so we cut the full version string to the first two tokens
|
||||||
run: echo "::set-output name=minor::$(cat VERSION.txt | cut -d "." -f 1,2)"
|
run: echo "minor=$(cat VERSION.txt | cut -d "." -f 1,2)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Sync docs with unstable release
|
- name: Sync docs with unstable release
|
||||||
# Instead of putting more logic into the previous step, let's just assume that commits on `main`
|
# Instead of putting more logic into the previous step, let's just assume that commits on `main`
|
||||||
|
19
.github/workflows/workflows_linting.yml
vendored
Normal file
19
.github/workflows/workflows_linting.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: Github workflows linter
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- ".github/workflows"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-workflows:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install actionlint
|
||||||
|
run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
|
||||||
|
|
||||||
|
- name: Run actionlint
|
||||||
|
run: actionlint
|
@ -20,5 +20,9 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: black-jupyter
|
- id: black-jupyter
|
||||||
|
|
||||||
|
- repo: https://github.com/rhysd/actionlint
|
||||||
|
rev: v1.6.23
|
||||||
|
hooks:
|
||||||
|
- id: actionlint
|
||||||
|
|
||||||
# TODO we can make mypy and pylint run at this stage too, once their execution gets normalized
|
# TODO we can make mypy and pylint run at this stage too, once their execution gets normalized
|
||||||
|
Loading…
x
Reference in New Issue
Block a user