Skip to content

Add config file for CodeQL analysis #814

Add config file for CodeQL analysis

Add config file for CodeQL analysis #814

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup environment
uses: ./.github/actions/environments
- name: Build schemas
shell: bash
env:
TTSC_CACHE_DIR: ${{ runner.temp }}/ttsc-cache
TTSC_GO_CACHE_DIR: ${{ runner.temp }}/ttsc-go-build
run: pnpm schemas:build
- name: Build website
run: pnpm website:build
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-artifacts
path: |
schemas/dist/
website/dist/
website/.content-collections/
website/.netlify/
retention-days: 1
include-hidden-files: true
lint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup environment
uses: ./.github/actions/environments
- uses: CatChen/oxlint-suggestion-action@79370fbca98639c3d2f8e2fc263daf87706ba692 # v1.0.9
with:
fail-check: true
format:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup environment
uses: ./.github/actions/environments
- name: Format
run: pnpm format
- uses: CatChen/check-git-status-action@cc5a79733c441f67cd0cd076de116cd2eebcebfe # v2.1.3
with:
fail-if-not-clean: true
request-changes-if-not-clean: true
request-changes-comment: "Unformatted files detected. Please run `pnpm format` and commit the changes."
typecheck:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifacts
- name: Setup environment
uses: ./.github/actions/environments
- name: Typecheck
run: pnpm typecheck
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifacts
- name: Setup environment
uses: ./.github/actions/environments
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium
- name: Test
run: pnpm test
e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifacts
- name: Setup environment
uses: ./.github/actions/environments
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium
- name: E2E Smoke tests
run: pnpm e2e --workers 50% --grep @smoke
- name: E2E Full tests
run: pnpm e2e --workers 50% --grep-invert @smoke
- name: Upload Playwright Report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
with:
name: playwright-report
path: "*/playwright-report/"
retention-days: 30
storybook-build:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifacts
- name: Setup environment
uses: ./.github/actions/environments
- name: Build Storybook
run: pnpm --filter website storybook:build
- name: Upload Storybook Build Artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: storybook-build-artifacts
path: "website/storybook-static/"
retention-days: 30