diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4d3fa555e..8116189fba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,61 +3,15 @@ name: Tests on: push jobs: + # The build itself lives in FlowFuse/github-actions-workflows so this repository and + # FlowFuse/flowfuse documentation pull requests share one definition. The check this + # reports is "test_website / Build and check", which the "protect main" ruleset requires. test_website: - runs-on: ubuntu-latest - steps: - - name: Generate a token - id: generate_token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - with: - client-id: ${{ secrets.GH_CI_READONLY_APP_ID }} - private-key: ${{ secrets.GH_CI_READONLY_APP_KEY }} - owner: ${{ github.repository_owner }} - repositories: | - website - blueprint-library - - name: Check out website repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: 'website' - token: ${{ steps.generate_token.outputs.token }} - - name: Check out FlowFuse/blueprint-library repository (to access the blueprints) - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: 'FlowFuse/blueprint-library' - ref: main - path: 'blueprint-library' - token: ${{ steps.generate_token.outputs.token }} - - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version: 24 - cache: 'npm' - cache-dependency-path: './website/package-lock.json' - - run: npm run blueprints - working-directory: 'website' - - name: Install Dependencies - run: npm install - working-directory: 'website' - - name: Cache nuxt-og-image font + rendered-image cache - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: | - website/nuxt/node_modules/.cache/nuxt/.nuxt/cache/og-image - website/nuxt/node_modules/.cache/nuxt/.nuxt/cache/og-image-render - # The rendered-image cache needs to accumulate newly-rendered images across runs - # (content-addressed by title/section hash, so it only grows, never goes stale) - - # actions/cache skips saving on an exact key hit, so the primary key includes - # run_id to force a save every run; restore-keys still finds the latest prior cache. - key: og-image-cache-${{ runner.os }}-${{ github.run_id }} - restore-keys: | - og-image-cache-${{ runner.os }}- - - name: Run unit tests - run: npm test - working-directory: 'website' - - name: Build the forge - run: npm run build:nuxt:skip-images - working-directory: 'website' - - name: Check links - uses: untitaker/hyperlink@9375bc4063712ad490d5eb3d54df0b6aade15e54 # 0.3.2 - with: - args: website/nuxt/dist/ --check-anchors --sources website/src + uses: FlowFuse/github-actions-workflows/.github/workflows/build_website.yml@build_website/v1 + with: + website_repository: ${{ github.repository }} + website_ref: ${{ github.sha }} + run_unit_tests: true + secrets: + ci_app_id: ${{ secrets.GH_CI_READONLY_APP_ID }} + ci_app_key: ${{ secrets.GH_CI_READONLY_APP_KEY }}