From f604ef6c694e88bcf2f22ce97a33bf131074326f Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Oct 2022 09:48:29 -0300 Subject: [PATCH] Run astro check on all examples in CI (#5022) * Run astro check on all examples in CI * Output stderr * Build Astro before running checks * Making things faster + colors * Fix errors inside examples * Add congrats message * Revert unentional change to tsconfigs * Remove more unneeded changes --- .github/workflows/check.yml | 47 +++++++++++ examples/framework-lit/src/pages/index.astro | 7 +- examples/non-html-pages/src/pages/index.astro | 8 +- .../src/components/PortfolioPreview.astro | 7 ++ examples/portfolio/src/layouts/project.astro | 7 +- examples/portfolio/src/pages/index.astro | 5 +- examples/portfolio/src/pages/projects.astro | 3 +- examples/portfolio/src/types.ts | 8 ++ examples/ssr/src/api.ts | 2 +- .../ssr/src/components/ProductListing.astro | 6 ++ .../src/components/TextDecorationSkip.astro | 4 + examples/ssr/src/pages/index.astro | 5 +- examples/with-tailwindcss/package.json | 3 +- .../src/components/Button.astro | 6 +- package.json | 1 + pnpm-lock.yaml | 13 ++- scripts/package.json | 3 + scripts/smoke/check.js | 84 +++++++++++++++++++ 18 files changed, 200 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/check.yml create mode 100644 examples/portfolio/src/types.ts create mode 100644 scripts/smoke/check.js diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000000..b8826f5383 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,47 @@ +name: Examples astro check + +on: + push: + branches: + - main + pull_request: + paths: + - 'examples/**' + - '.github/workflows/check.yml' + - 'scripts/smoke/check.js' + - 'packages/astro/src/@types/astro.ts' + +env: + ASTRO_TELEMETRY_DISABLED: true + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + FORCE_COLOR: true + +jobs: + check: + name: astro check + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Setup PNPM + uses: pnpm/action-setup@v2.2.1 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Status + run: git status + + - name: astro check + run: pnpm run test:check-examples diff --git a/examples/framework-lit/src/pages/index.astro b/examples/framework-lit/src/pages/index.astro index 4f0dbc3096..d193842a06 100644 --- a/examples/framework-lit/src/pages/index.astro +++ b/examples/framework-lit/src/pages/index.astro @@ -19,6 +19,11 @@ import { MyCounter } from '../components/my-counter.js';