|
| 1 | +name: "Copilot Setup Steps" |
| 2 | + |
| 3 | +# Automatically run the setup steps when they are changed to allow for easy validation, and |
| 4 | +# allow manual testing through the repository's "Actions" tab |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + push: |
| 8 | + paths: |
| 9 | + - .github/workflows/copilot-setup-steps.yml |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - .github/workflows/copilot-setup-steps.yml |
| 13 | + |
| 14 | +jobs: |
| 15 | + # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. |
| 16 | + copilot-setup-steps: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + # Set the permissions to the lowest permissions possible needed for your steps. |
| 20 | + # Copilot will be given its own token for its operations. |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout code |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Set up Node.js |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: "20" |
| 32 | + cache: "yarn" |
| 33 | + |
| 34 | + - name: Install dependencies |
| 35 | + run: yarn install --frozen-lockfile |
| 36 | + env: |
| 37 | + # Skip Playwright browser downloads to avoid installation failures |
| 38 | + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 |
| 39 | + |
| 40 | + - name: Install Playwright browsers (if needed) |
| 41 | + run: | |
| 42 | + if [ -d "node_modules/playwright" ]; then |
| 43 | + echo "Installing Playwright browsers..." |
| 44 | + npx playwright install --with-deps |
| 45 | + else |
| 46 | + echo "Playwright not found, skipping browser installation" |
| 47 | + fi |
| 48 | + continue-on-error: true |
| 49 | + |
| 50 | + - name: Update VS Code type definitions |
| 51 | + run: yarn update-dts |
| 52 | + |
| 53 | + - name: Basic build verification |
| 54 | + run: | |
| 55 | + echo "Verifying basic setup..." |
| 56 | + if [ ! -d "node_modules" ]; then |
| 57 | + echo "❌ node_modules not found" |
| 58 | + exit 1 |
| 59 | + fi |
| 60 | + if [ ! -f "node_modules/.bin/tsc" ]; then |
| 61 | + echo "❌ TypeScript compiler not found" |
| 62 | + exit 1 |
| 63 | + fi |
| 64 | + if [ ! -f "node_modules/.bin/webpack" ]; then |
| 65 | + echo "❌ Webpack not found" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | + echo "✅ Basic setup verification successful" |
0 commit comments