name: CI on: pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: install-and-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./.gitea/actions/setup - name: Clean install dependencies run: npm ci - name: Production build run: npm run build - name: Archive dependencies run: tar -czf node_modules.tar.gz node_modules - uses: actions/upload-artifact@v3 with: name: node_modules-${{ github.run_id }} path: node_modules.tar.gz - name: Archive build artifacts run: tar -czf build-artifacts.tar.gz dist - uses: actions/upload-artifact@v3 with: name: build-artifacts-${{ github.run_id }} path: build-artifacts.tar.gz lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./.gitea/actions/setup - name: Clean install dependencies run: npm ci - name: Lint run: npm run lint format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./.gitea/actions/setup - name: Clean install dependencies run: npm ci - name: Check formatting run: npm run format:check typecheck-source: runs-on: ubuntu-latest needs: install-and-build steps: - uses: actions/checkout@v4 - uses: ./.gitea/actions/setup - uses: actions/download-artifact@v3 with: name: node_modules-${{ github.run_id }} - uses: actions/download-artifact@v3 with: name: build-artifacts-${{ github.run_id }} - name: Restore dependencies and build artifacts run: | tar -xzf node_modules.tar.gz tar -xzf build-artifacts.tar.gz - name: Typecheck source run: npm run typecheck typecheck-tests: runs-on: ubuntu-latest needs: install-and-build steps: - uses: actions/checkout@v4 - uses: ./.gitea/actions/setup - uses: actions/download-artifact@v3 with: name: node_modules-${{ github.run_id }} - name: Restore dependencies run: tar -xzf node_modules.tar.gz - name: Typecheck tests run: npm run typecheck:test test: runs-on: ubuntu-latest needs: install-and-build steps: - uses: actions/checkout@v4 - uses: ./.gitea/actions/setup - uses: actions/download-artifact@v3 with: name: node_modules-${{ github.run_id }} - name: Restore dependencies run: tar -xzf node_modules.tar.gz - name: Run full test suite run: npm test