Skip to content

Commit

Permalink
Github action run pre-commit to launch all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Nov 8, 2023
1 parent 26653b4 commit f5b87fc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 160 deletions.
62 changes: 21 additions & 41 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,24 @@ on: # yamllint disable-line rule:truthy
jobs:
linters:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
vendor:
- ubuntu
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install pre-commit
run: pip install pre-commit

- uses: ouzi-dev/commit-status-updater@v2
with:
name: lint
status: pending

- name: Linting - Dockerfile
run: |
set -exo pipefail
./bin/dockerLint -f checkstyle | tee logs/docker-checkstyle.xml
- name: Linting - Shellcheck
run: |
set -exo pipefail
./bin/shellcheckLint -f checkstyle | \
tee logs/shellcheck-checkstyle.xml
- name: Linting - Framework
run: |
./bin/frameworkLint -f checkstyle --expected-warnings-count 72 |
tee logs/framework-checkstyle.xml
- name: Linting - Awk
run: |
set -exo pipefail
./bin/awkLint | tee logs/awk-checkstyle.xml
- name: build bin files + check md5
run: |
set -exo pipefail
./bin/buildBinFiles 2>&1 | tee logs/buildBinFiles.log
- name: check megalinter version
run: |
set -exo pipefail
status=0
newVersion="$(./bin/megalinter --check-megalinter-version)" || status=$?
if [[ "${status}" != "0" ]] ; then
echo "::warning file=.mega-linter.yml,title=new version of megalinter available::${newVersion}"
fi
- name: Run pre-commit
run: pre-commit run -a --hook-stage manual

- name: Archive results
uses: actions/upload-artifact@v3
Expand All @@ -65,6 +35,16 @@ jobs:
logs/*.xml
logs/*.log
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: update/pre-commit-fixes
title: lint fixes
commit-message: Auto-update lint fixes
body: |
some auto fixes have been generated during pre-commit run
labels: updates

- uses: ouzi-dev/commit-status-updater@v2
if: always()
with:
Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/mega-linter.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
exclude: ^doc/guides/Options/generate.*.md$

- repo: .
rev: 009c8a9560f43300444079ca6634251f73501d8a
rev: 26653b4d1797bac8e6a7d8e07b04a76e4c1c6ec0
hooks:
- id: fixShebangExecutionBit
- id: awkLint
Expand Down Expand Up @@ -87,9 +87,10 @@ repos:

# manual stage used to select github action with megalinter full config
- repo: .
rev: 009c8a9560f43300444079ca6634251f73501d8a
rev: 26653b4d1797bac8e6a7d8e07b04a76e4c1c6ec0
hooks:
- id: runUnitTests
stages: [pre-commit]
- id: megalinterCheckVersion
- id: megalinter
- id: megalinterGithubAction

0 comments on commit f5b87fc

Please sign in to comment.