Add skeleton in drawer #290
This file contains 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: CI | |
on: | |
push: | |
schedule: | |
- cron: "0 21 * * 0" | |
env: | |
CI: true | |
TURBO_API: http://127.0.0.1:9080 | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: foo | |
jobs: | |
check-spelling: | |
name: Check spelling | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: marshallku/actions/analyze/spell@master | |
build: | |
name: Build all packages and apps | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: marshallku/marshallku-blog-posts | |
path: apps/blog/_posts | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: marshallku/actions/setup/pnpm@master | |
- name: TurboRepo server | |
uses: felixmosh/turborepo-gh-artifacts@v3 | |
with: | |
repo-token: ${{ github.token }} | |
- name: Build apps and packages | |
run: pnpm build | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
lint: | |
name: Lint all packages and apps | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: marshallku/actions/setup/pnpm@master | |
- name: TurboRepo server | |
uses: felixmosh/turborepo-gh-artifacts@v3 | |
with: | |
repo-token: ${{ github.token }} | |
- name: Check code quality | |
run: pnpm lint | |
code-ql-analyze: | |
name: Analyze (${{ matrix.language }}) with CodeQL | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 360 | |
permissions: | |
security-events: write | |
packages: read | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- language: javascript-typescript | |
build-mode: none | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
build-mode: ${{ matrix.build-mode }} | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{matrix.language}}" | |
test: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: marshallku/actions/setup/pnpm@master | |
- name: TurboRepo server | |
uses: felixmosh/turborepo-gh-artifacts@v3 | |
with: | |
repo-token: ${{ github.token }} | |
- name: Run tests | |
run: pnpm test | |
test-blog-e2e: | |
name: Run e2e test in blog | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: marshallku/marshallku-blog-posts | |
path: apps/blog/_posts | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: marshallku/actions/setup/pnpm@master | |
- name: TurboRepo server | |
uses: felixmosh/turborepo-gh-artifacts@v3 | |
with: | |
repo-token: ${{ github.token }} | |
- name: Setup playwright | |
run: pnpm exec playwright install --with-deps | |
- name: Build applications | |
run: pnpm build | |
- name: Run test | |
run: pnpm test:e2e --filter @marshallku/blog | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: apps/blog/test-results/ | |
retention-days: 30 | |
lighthouse: | |
name: Lighthouse CI | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: marshallku/marshallku-blog-posts | |
path: apps/blog/_posts | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: marshallku/actions/setup/pnpm@master | |
- name: TurboRepo server | |
uses: felixmosh/turborepo-gh-artifacts@v3 | |
with: | |
repo-token: ${{ github.token }} | |
- name: Build app | |
run: | | |
cp apps/blog/.env.example apps/blog/.env | |
pnpm build --filter @marshallku/blog | |
cp -r apps/blog/.next/static apps/blog/.next/standalone/apps/blog/.next | |
cp -r apps/blog/public apps/blog/.next/standalone/apps/blog/ | |
- name: Run Lighthouse CI | |
env: | |
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
run: | | |
cd apps/blog | |
npm i -g @lhci/cli | |
lhci autorun | |
send-notification: | |
needs: [check-spelling, build, lint, test, test-blog-e2e, code-ql-analyze, lighthouse] | |
if: ${{ failure() }} | |
uses: marshallku/actions/.github/workflows/send-notification.yml@master | |
with: | |
failed: ${{ contains(join(needs.*.result, ','), 'failure') }} | |
message: "CI job failed" | |
secrets: | |
url: ${{ secrets.DISCORD_WEBHOOK_URI }} |