ci(workflow): fix set-env job (checkout + token) #744
Workflow file for this run
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
name: Lint | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
lint-commits: | |
runs-on: ubuntu-22.04 | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check commits | |
uses: wagoid/commitlint-github-action@v6 | |
lint-markdown: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Lint markdown files | |
uses: avto-dev/[email protected] | |
with: | |
args: "**/*.md" | |
ignore: "./CHANGELOG.md" | |
lint-yaml: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Lint yaml files | |
uses: ibiqlik/[email protected] | |
lint-ontology: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Find changed ttl files | |
id: changed-ttl-files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
src/**/*.ttl | |
test/**/*.ttl | |
example/**/*.ttl | |
Makefile | |
- name: Validate rdf files (turtle) | |
if: steps.changed-ttl-files.outputs.any_changed == 'true' | |
run: | | |
make lint-ttl | |
- name: Check rdf files (turtle) are formatted | |
if: steps.changed-ttl-files.outputs.any_changed == 'true' | |
run: | | |
make format-ttl | |
if [[ $(git status -s) ]]; then | |
>&2 echo "β There is a diff between formatted files and source code" | |
>&2 git status | |
exit 1 | |
fi | |
lint-generated: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Generate documentation | |
run: | | |
find docs -type f -name "*.md" -exec chmod 666 {} + | |
make docs | |
env: | |
NUMBER_OF_THE_BEAST: 666 | |
- name: Check Git diff in generated files (proto + docs) | |
run: | | |
if [[ $(git status -s) != "" ]]; then | |
>&2 echo "β There is a diff between generated files and source code" | |
>&2 git status | |
exit 1 | |
fi | |
lint-poetry: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check if poetry files have changed | |
id: changed-poetry-files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
script/poetry.lock | |
script/pyproject.toml | |
- name: Install Python | |
if: steps.changed-poetry-files.outputs.any_changed == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Python Poetry | |
if: steps.changed-poetry-files.outputs.any_changed == 'true' | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.7.1 | |
- name: Check poetry config is valid | |
if: steps.changed-poetry-files.outputs.any_changed == 'true' | |
working-directory: script | |
run: | | |
poetry check | |
lint-python: | |
needs: lint-poetry | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check if python files have changed | |
id: changed-python-files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
script/**/*.* | |
- name: Install Python | |
if: steps.changed-python-files.outputs.any_changed == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Python Poetry | |
if: steps.changed-python-files.outputs.any_changed == 'true' | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.7.1 | |
- name: Install project dependencies | |
if: steps.changed-python-files.outputs.any_changed == 'true' | |
working-directory: script | |
run: | | |
poetry install | |
- name: Lint python code (flake8) | |
if: steps.changed-python-files.outputs.any_changed == 'true' | |
working-directory: script | |
run: | | |
poetry run flake8 --count --show-source --statistics | |
- name: Lint python code (mypy) | |
if: steps.changed-python-files.outputs.any_changed == 'true' | |
working-directory: script | |
run: | | |
poetry run mypy --config-file ./mypy.ini . |