|
| 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 run before the agent starts working |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 28 | + |
| 29 | + # JavaScript/TypeScript linting |
| 30 | + - name: Setup Node.js |
| 31 | + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 |
| 32 | + with: |
| 33 | + node-version: "24" |
| 34 | + cache: "npm" |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + run: npm ci |
| 38 | + |
| 39 | + - name: Display environment info |
| 40 | + run: | |
| 41 | + echo "=========================================" |
| 42 | + echo "Environment Setup Complete" |
| 43 | + echo "=========================================" |
| 44 | + echo "Node version: $(node --version)" |
| 45 | + echo "npm version: $(npm --version)" |
| 46 | + echo "TypeScript version: $(npx tsc --version)" |
| 47 | + echo "Working directory: $(pwd)" |
| 48 | + echo "Build artifacts: $(ls -la dist/ 2>/dev/null | wc -l) files" |
| 49 | + echo "=========================================" |
| 50 | +
|
| 51 | + - name: Cache build artifacts |
| 52 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.0 |
| 53 | + with: |
| 54 | + path: | |
| 55 | + node_modules |
| 56 | + dist |
| 57 | + key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }} |
| 58 | + restore-keys: | |
| 59 | + ${{ runner.os }}-build- |
0 commit comments