2022-04-25 15:27:10 +02:00
|
|
|
name: Project
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
types: [opened, reopened, synchronize, edited]
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
pre-commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-06-08 20:10:55 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2022-06-09 09:50:36 +02:00
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2022-09-01 19:31:33 +02:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-project-pre-commit-pip-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-project-pre-commit-pip
|
|
|
|
|
2022-06-05 23:54:28 +02:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-04-25 15:27:10 +02:00
|
|
|
|
|
|
|
check-shell:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-06-08 20:10:55 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2022-06-09 09:50:36 +02:00
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2022-09-01 19:32:38 +02:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-project-check-shell-pip
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-project-check-shell-pip
|
|
|
|
|
2022-09-01 19:36:10 +02:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
/usr/local/bin/shellcheck*
|
|
|
|
/usr/local/bin/shfmt*
|
|
|
|
key: ${{ runner.os }}-project-check-shell-tools
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-project-check-shell-tools
|
|
|
|
|
2022-04-25 15:27:10 +02:00
|
|
|
- run: |
|
|
|
|
python -m venv venv && source venv/bin/activate
|
|
|
|
pip install gh-release-install
|
|
|
|
|
|
|
|
sudo venv/bin/gh-release-install \
|
|
|
|
koalaman/shellcheck \
|
|
|
|
shellcheck-{tag}.linux.x86_64.tar.xz --extract shellcheck-{tag}/shellcheck \
|
2022-09-01 19:36:10 +02:00
|
|
|
/usr/local/bin/shellcheck \
|
|
|
|
--version-file '{destination}.version'
|
2022-04-25 15:27:10 +02:00
|
|
|
|
|
|
|
sudo venv/bin/gh-release-install \
|
|
|
|
mvdan/sh \
|
|
|
|
shfmt_{tag}_linux_amd64 \
|
2022-09-01 19:36:10 +02:00
|
|
|
/usr/local/bin/shfmt \
|
|
|
|
--version-file '{destination}.version'
|
2022-04-25 15:27:10 +02:00
|
|
|
|
|
|
|
- run: SEVERITY=warning make shell-check
|
|
|
|
|
|
|
|
test-tools:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-06-08 20:10:55 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2022-06-09 09:50:36 +02:00
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2022-04-25 15:27:10 +02:00
|
|
|
- run: make all
|
|
|
|
working-directory: tools
|