-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update pre-commit workflow to use pre-commit/[email protected]
this should be faster (after the first run) and better supported
- Loading branch information
Showing
1 changed file
with
5 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,56 +10,21 @@ on: | |
|
||
name: Run pre-commit checks | ||
|
||
env: | ||
# https://laszlo.cloud/setting-gopath-in-github-actions | ||
GOPATH: /home/runner/work/woodpecker/go | ||
|
||
jobs: | ||
linting: | ||
name: run pre-commit checks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# https://github.com/actions/setup-python#usage | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Setup Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
python-version: '3.10' | ||
- uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: 1.4.2 | ||
|
||
poetry-version: 1.5.1 | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
poetry install | ||
# yamllint disable-line rule:line-length | ||
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path | ||
- name: Update PATH | ||
run: | | ||
echo $PATH | ||
echo "$GOPATH/bin" >> $GITHUB_PATH | ||
- name: Install external deps for precommit | ||
# yamllint disable rule:line-length | ||
run: | | ||
curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh | ||
go install github.com/sqs/goreturns@latest | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
go install github.com/mgechev/revive@latest | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
# goreturns doesn't share its version | ||
# goimports doesn't share its version | ||
gosec --version | ||
revive --version | ||
# yamllint enable rule:line-length | ||
|
||
- name: Run precommit checks | ||
run: | | ||
pip install pre-commit | ||
pre-commit run --all-files | ||
- uses: pre-commit/[email protected] |