mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Add the pre-commit job to the workflow
This commit is contained in:
parent
a165c16553
commit
b3b70c1561
3 changed files with 31 additions and 5 deletions
23
.github/workflows/main.yml
vendored
23
.github/workflows/main.yml
vendored
|
@ -8,6 +8,28 @@ on: [push, pull_request]
|
|||
|
||||
jobs:
|
||||
|
||||
generate-actions-workflow:
|
||||
name: Generate The Actions Workflow
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
|
||||
- name: Install Pre-Commit
|
||||
run: |
|
||||
pip install -U pip
|
||||
pip install pre-commit
|
||||
pre-commit install
|
||||
|
||||
- name: Generate Workflow Actions
|
||||
run: |
|
||||
pre-commit run -v generate-actions-workflow
|
||||
|
||||
|
||||
Lint:
|
||||
runs-on: ubuntu-latest
|
||||
container: koalaman/shellcheck-alpine:v0.6.0
|
||||
|
@ -18,7 +40,6 @@ jobs:
|
|||
shellcheck -s sh -f checkstyle bootstrap-salt.sh
|
||||
|
||||
|
||||
|
||||
amazon-2-2019-2-py2-stable:
|
||||
name: Amazon 2 2019.2 Py2 Stable
|
||||
runs-on: ubuntu-latest
|
||||
|
|
10
.github/workflows/templates/generate.py
vendored
10
.github/workflows/templates/generate.py
vendored
|
@ -128,13 +128,19 @@ def generate_test_jobs():
|
|||
with open('lint.yml') as rfh:
|
||||
lint_job = '\n{}\n'.format(rfh.read())
|
||||
|
||||
with open('pre-commit.yml') as rfh:
|
||||
pre_commit_job = '\n{}\n'.format(rfh.read())
|
||||
|
||||
with open('../main.yml', 'w') as wfh:
|
||||
with open('main.yml') as rfh:
|
||||
wfh.write(
|
||||
'{}\n'.format(
|
||||
rfh.read().format(
|
||||
lint_job=lint_job,
|
||||
test_jobs=test_jobs,
|
||||
jobs='{pre_commit}{lint}{test}'.format(
|
||||
lint=lint_job,
|
||||
test=test_jobs,
|
||||
pre_commit=pre_commit_job,
|
||||
)
|
||||
).strip()
|
||||
)
|
||||
)
|
||||
|
|
3
.github/workflows/templates/main.yml
vendored
3
.github/workflows/templates/main.yml
vendored
|
@ -7,5 +7,4 @@ name: Testing
|
|||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
{lint_job}
|
||||
{test_jobs}
|
||||
{jobs}
|
||||
|
|
Loading…
Add table
Reference in a new issue