chore: address code review comments #617
This file contains hidden or 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: Circuit UI App Templates | |
| on: | |
| push: | |
| paths: | |
| - "templates/**" | |
| schedule: | |
| - cron: "0 3 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs | |
| matrix: | |
| node: [22, 24] | |
| template: [astro, nextjs] | |
| include: | |
| - template: astro | |
| bootstrap: "npx create-astro@latest ./test-app --template sumup-oss/circuit-ui/templates/astro --install --no-git --typescript=strictest" | |
| verify: "npm run lint:fix && npm run astro check" | |
| start: "npm run preview" | |
| - template: nextjs | |
| bootstrap: 'npx create-next-app --example "https://github.com/sumup-oss/circuit-ui/tree/main/templates/nextjs/template" test-app' | |
| verify: "npm run lint:fix && npm run test:ci" | |
| start: "npm run start" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: "npm" | |
| - name: Update npm | |
| run: npm install -g npm@11.7.0 | |
| - name: Bootstrap app | |
| run: ${{ matrix.bootstrap }} | |
| - name: Build app | |
| working-directory: ./test-app | |
| run: npm run build | |
| - name: Static analysis | |
| working-directory: ./test-app | |
| run: ${{ matrix.verify }} | |
| - name: Install test dependencies | |
| run: npm install puppeteer | |
| - name: Test app | |
| working-directory: ./test-app | |
| # We use aa-exec since Ubuntu 24.04's AppArmor profile blocks the use | |
| # of puppeteer otherwise, see | |
| # https://github.com/puppeteer/puppeteer/issues/12818 | |
| run: npx start-server-and-test '${{ matrix.start }} -- --port=3000' localhost:3000 "aa-exec --profile=chrome node ../scripts/verify-template.js" |