mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
name: Static Analysis
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
version-check:
|
|
runs-on: macos-14
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check version is up to date
|
|
run: |
|
|
make -f scripts/Makefile version
|
|
if [ -z "$(git status --porcelain)" ]; then
|
|
# Working directory clean
|
|
echo "Version manifests up to date"
|
|
else
|
|
# Uncommitted changes
|
|
echo '`make version` found outdated files! Showing diff'
|
|
git diff
|
|
exit 1
|
|
fi
|
|
|
|
link-check:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: lycheeverse/lychee-action@v1.9.0
|
|
with:
|
|
fail: true
|
|
args: --offline --verbose --no-progress **/*.md
|
|
|
|
global-linter:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
- uses: actions/cache/restore@v4
|
|
name: Restore Python Cache
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ubuntu-22.04-${{ runner.arch }}-pip-${{ hashFiles('.github/requirements.txt') }}
|
|
restore-keys: |
|
|
ubuntu-22.04-${{ runner.arch }}-pip-
|
|
- name: Install Python Dependencies
|
|
run: |
|
|
pip install -r .github/requirements.txt
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y shfmt
|
|
- name: Run pre-commit
|
|
run: |
|
|
pre-commit install --config .github/pre-commit-config.yaml
|
|
SKIP=no-commit-to-branch pre-commit run --all-files --config .github/pre-commit-config.yaml
|
|
- uses: actions/cache/save@v4
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
name: Save Python Cache
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ubuntu-22.04-${{ runner.arch }}-pip-${{ hashFiles('.github/requirements.txt') }}
|