|
15 | 15 | permissions: |
16 | 16 | contents: read |
17 | 17 |
|
| 18 | +env: |
| 19 | + NODE_VERSION: 24 |
| 20 | + |
18 | 21 | jobs: |
19 | 22 | actions_lint_check: |
20 | 23 | name: Actions lint check |
|
46 | 49 | with: |
47 | 50 | python_versions: '["3.11", "3.12", "3.13", "3.14"]' |
48 | 51 |
|
| 52 | + markdown_lint_check: |
| 53 | + name: Markdown lint check |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - name: Checkout repository |
| 57 | + uses: actions/checkout@v7 |
| 58 | + |
| 59 | + - name: Set up Node |
| 60 | + uses: actions/setup-node@v6 |
| 61 | + with: |
| 62 | + node-version: ${{ env.NODE_VERSION }} |
| 63 | + |
| 64 | + - name: Install pnpm and website dependencies |
| 65 | + uses: apify/actions/pnpm-install@v1.2.0 |
| 66 | + with: |
| 67 | + working-directory: website |
| 68 | + |
| 69 | + - name: Lint Markdown |
| 70 | + run: pnpm lint:md |
| 71 | + working-directory: website |
| 72 | + |
| 73 | + website_lint_check: |
| 74 | + name: Website lint check |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - name: Checkout repository |
| 78 | + uses: actions/checkout@v7 |
| 79 | + |
| 80 | + - name: Set up Node |
| 81 | + uses: actions/setup-node@v6 |
| 82 | + with: |
| 83 | + node-version: ${{ env.NODE_VERSION }} |
| 84 | + |
| 85 | + - name: Install pnpm and website dependencies |
| 86 | + uses: apify/actions/pnpm-install@v1.2.0 |
| 87 | + with: |
| 88 | + working-directory: website |
| 89 | + |
| 90 | + - name: Lint website code |
| 91 | + run: pnpm lint:code |
| 92 | + working-directory: website |
| 93 | + |
| 94 | + - name: Check website formatting |
| 95 | + run: pnpm format:check |
| 96 | + working-directory: website |
| 97 | + |
| 98 | + image_lint_check: |
| 99 | + name: Image lint check |
| 100 | + runs-on: ubuntu-latest |
| 101 | + steps: |
| 102 | + - name: Checkout repository |
| 103 | + uses: actions/checkout@v7 |
| 104 | + with: |
| 105 | + fetch-depth: 0 |
| 106 | + |
| 107 | + # Doc images must be committed as optimized `.webp`. This fails when a PR adds raster |
| 108 | + # images in another format so they get converted via `pnpm opt:images` first. |
| 109 | + - name: Get changed unoptimized images |
| 110 | + id: changed-files |
| 111 | + uses: tj-actions/changed-files@v47 |
| 112 | + with: |
| 113 | + files: | |
| 114 | + docs/**/*.{png,jpg,jpeg,gif,bmp,tif,tiff,avif} |
| 115 | + website/static/**/*.{png,jpg,jpeg,gif,bmp,tif,tiff,avif} |
| 116 | + separator: "\n" |
| 117 | + |
| 118 | + - name: Fail on unoptimized images |
| 119 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 120 | + env: |
| 121 | + UNOPTIMIZED_IMAGE_FILES: ${{ steps.changed-files.outputs.all_changed_files }} |
| 122 | + run: | |
| 123 | + echo "Unoptimized images detected! Convert each one to WebP, e.g.:" |
| 124 | + echo "" |
| 125 | + while IFS= read -r file_path; do |
| 126 | + echo " (cd website && pnpm opt:images \"../$file_path\")" |
| 127 | + done <<< "$UNOPTIMIZED_IMAGE_FILES" |
| 128 | + echo "" |
| 129 | + echo "Then reference the resulting .webp files in your Markdown." |
| 130 | + exit 1 |
| 131 | +
|
49 | 132 | unit_tests: |
50 | 133 | name: Unit tests |
51 | 134 | if: inputs.run_tests |
|
0 commit comments