Skip to content

Add Makefile wrapping tools/ scripts #129

Add Makefile wrapping tools/ scripts

Add Makefile wrapping tools/ scripts #129

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
env:
MIN_COVERAGE: ${{ vars.MIN_COVERAGE }}
SERVER_BINARY: build/bin/server_node.js
jobs:
website:
name: Website Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: website/package-lock.json
- name: Install dependencies
working-directory: website
run: npm ci
- name: Get Playwright version
id: playwright-version
working-directory: website
run: echo "version=$(npm ls @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: website
run: npx playwright install --with-deps chromium
- name: Install Playwright deps only (cached)
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Build website
working-directory: website
run: npm run build
- name: Run tests
working-directory: website
run: npm test
packages:
name: Lint, Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
dart-version: ${{ vars.DART_VERSION }}
- name: Install tools
run: |
npm install -g cspell
dart pub global activate coverage
- name: Get all dependencies
run: |
for dir in packages/* examples/* tools/build; do
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
echo "::group::$dir"
cd $dir && dart pub get && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Install npm dependencies
run: |
for dir in packages/* examples/*; do
if [ -d "$dir" ] && [ -f "$dir/package.json" ]; then
echo "::group::npm install $dir"
cd $dir && npm install && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Spell check
run: cspell "**/*.md" "**/*.dart" "**/*.ts" --no-progress
- name: Check formatting
run: |
dart format --set-exit-if-changed packages/
dart format --set-exit-if-changed examples/
dart format --set-exit-if-changed tools/build
- name: Analyze
run: |
for dir in packages/* examples/* tools/build; do
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
echo "::group::Analyzing $dir"
cd $dir && dart analyze --no-fatal-warnings && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Test Tier 1
run: ./tools/test.sh --tier 1
- name: Test Tier 2
run: ./tools/test.sh --tier 2
- name: Test Tier 3
run: ./tools/test.sh --tier 3
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: logs/
retention-days: 7