Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
compile:
name: Compiles
runs-on: ubuntu-latest
defaults:
run:
shell: bash --noprofile --norc -eo pipefail {0}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -27,12 +30,12 @@ jobs:
node_modules/.astro
key: static

- run: npm ci
- run: npm run check
- run: npm ci |& tee -a build.log

- run: npm run check
- run: npm run format:core:check
## TODO: content formatting checks
- run: npm run build
- run: npm run build |& tee -a build.log
env:
NODE_OPTIONS: "--max-old-space-size=4192"
RUN_LINK_CHECK: true
Expand All @@ -50,3 +53,18 @@ jobs:

- name: Tests
run: npm run test

- name: post build errors as PR comment
if: failure()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# remove ANSI colours & try find some known error strings
ERRORS=$(cat build.log | sed 's/\x1B\[[0-9;]*[A-Za-z]//g' | awk 'tolower($0) ~ /\[.*error.*\]|npm err|\[vite\] error /,0')

if [ -n "$ERRORS" ]; then
URL=$(gh run view ${{ github.run_id }} --json url --jq '.url')
BODY="[Build failed]($URL)\n\n\`\`\`txt\n$ERRORS\n\`\`\`"

echo -e "$BODY" | gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file -
fi
2 changes: 1 addition & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default defineConfig({
...(runLinkCheck
? [
starlightLinksValidator({
errorOnInvalidHashes: false,
errorOnInvalidHashes: true,
errorOnLocalLinks: false,
exclude: [
"/api/",
Expand Down
Loading