|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + merge_group: |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: "${{ github.ref }}" |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | + |
| 16 | +jobs: |
| 17 | + lint: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + # required for upload-sarif action |
| 21 | + # https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github#example-workflow-for-sarif-files-generated-outside-of-a-repository |
| 22 | + security-events: write |
| 23 | + contents: read |
| 24 | + steps: |
| 25 | + |
| 26 | + - uses: astral-sh/[email protected] |
| 27 | + id: setup-uv |
| 28 | + with: |
| 29 | + # renovate: datasource=pypi dependency=uv |
| 30 | + version: "0.5.25" |
| 31 | + # ubuntu-latest already has Python 3.x installed (pip is needed by the pre-commit action) |
| 32 | + - name: Print the installed versions |
| 33 | + run: | |
| 34 | + echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" |
| 35 | + echo "Installed Python version is $(python --version)" |
| 36 | + uv python list |
| 37 | + - uses: pre-commit/[email protected] |
| 38 | + - name: Run markdownlint |
| 39 | + uses: YannickTeKulve/[email protected] |
| 40 | + with: |
| 41 | + image: davidanson/markdownlint-cli2-rules:v0.17.2 |
| 42 | + # node user does not have permissions to workspace due to user id mismatch |
| 43 | + options: -v ${{ github.workspace }}:/workdir --user root |
| 44 | + # use the config file that is stored outside the root for CI specific configuration |
| 45 | + # don't fail step if there are violations |
| 46 | + run: markdownlint-cli2 --config .github/markdownlint/.markdownlint-cli2.yaml "**/*.md" || true |
| 47 | + # Needs to be a public repo in order for uploading SARIF files to work |
| 48 | + # https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github |
| 49 | + # - uses: github/codeql-action/upload-sarif@v3 |
| 50 | + # with: |
| 51 | + # # Path to SARIF file relative to the root of the repository |
| 52 | + # sarif_file: markdownlint-cli2-sarif.sarif |
| 53 | + # # Optional category for the results |
| 54 | + # # Used to differentiate multiple results for one commit |
| 55 | + # category: markdownlint |
| 56 | + # fail if there are markdownlint violations |
| 57 | + - name: Check markdownlint results |
| 58 | + run: | |
| 59 | + cat markdownlint-cli2-sarif.sarif | grep -q '"results": \[\]' |
| 60 | +
|
| 61 | +
|
| 62 | + build: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + needs: |
| 65 | + - lint |
| 66 | + steps: |
| 67 | + |
| 68 | + with: |
| 69 | + # fetch the full git history to be able to determine creation dates for pages |
| 70 | + # see: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin?tab=readme-ov-file#note-when-using-build-environments |
| 71 | + fetch-depth: 0 |
| 72 | + - uses: astral-sh/[email protected] |
| 73 | + id: setup-uv |
| 74 | + with: |
| 75 | + # renovate: datasource=pypi dependency=uv |
| 76 | + version: "0.5.25" |
| 77 | + python-version: 3.13 |
| 78 | + - name: Print the installed versions |
| 79 | + run: | |
| 80 | + echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" |
| 81 | + echo "Installed Python version is $(python --version)" |
| 82 | + uv python list |
| 83 | + - name: Install dependencies |
| 84 | + run: uv pip install -r requirements.txt |
| 85 | + |
| 86 | + with: |
| 87 | + # weekly cache |
| 88 | + key: mkdocs-material-$(date --utc '+%V') |
| 89 | + path: .cache |
| 90 | + restore-keys: | |
| 91 | + mkdocs-material- |
| 92 | + - name: Build site |
| 93 | + run: mkdocs build --strict |
0 commit comments