|
43 | 43 | - name: Test
|
44 | 44 | id: test
|
45 | 45 | run: npm run ci-test
|
| 46 | + |
| 47 | + test-templates: |
| 48 | + name: Test Actions Templates |
| 49 | + runs-on: ubuntu-latest |
| 50 | + |
| 51 | + defaults: |
| 52 | + run: |
| 53 | + shell: bash |
| 54 | + working-directory: local-action |
| 55 | + |
| 56 | + steps: |
| 57 | + - name: Checkout @github/local-action |
| 58 | + id: checkout |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + path: local-action |
| 62 | + |
| 63 | + - name: Checkout TypeScript Template |
| 64 | + id: checkout-typescript |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + path: typescript-action |
| 68 | + repository: actions/typescript-action |
| 69 | + |
| 70 | + - name: Checkout JavaScript Template |
| 71 | + id: checkout-javascript |
| 72 | + uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + path: javascript-action |
| 75 | + repository: actions/javascript-action |
| 76 | + |
| 77 | + - name: Setup Node.js |
| 78 | + id: setup-node |
| 79 | + uses: actions/setup-node@v4 |
| 80 | + with: |
| 81 | + node-version-file: local-action/.node-version |
| 82 | + cache: npm |
| 83 | + cache-dependency-path: local-action/package-lock.json |
| 84 | + |
| 85 | + - name: Install @github/local-action Dependencies |
| 86 | + id: install |
| 87 | + run: npm ci |
| 88 | + |
| 89 | + - name: Install TypeScript Template Dependencies |
| 90 | + id: install-typescript |
| 91 | + run: npm ci |
| 92 | + working-directory: typescript-action |
| 93 | + |
| 94 | + - name: Install JavaScript Template Dependencies |
| 95 | + id: install-javascript |
| 96 | + run: npm ci |
| 97 | + working-directory: javascript-action |
| 98 | + |
| 99 | + - name: Link @github/local-action |
| 100 | + id: link |
| 101 | + run: npm link |
| 102 | + |
| 103 | + - name: Generate Dotenv File |
| 104 | + id: dotenv |
| 105 | + run: | |
| 106 | + echo "ACTIONS_STEP_DEBUG=true" >> .env |
| 107 | + echo "INPUT_MILLISECONDS=2400" >> .env |
| 108 | +
|
| 109 | + - name: Test TypeScript Action |
| 110 | + id: test-typescript |
| 111 | + run: npx @github/local-action . src/main.ts ../local-action/.env |
| 112 | + working-directory: typescript-action |
| 113 | + |
| 114 | + - name: Test JavaScript Action |
| 115 | + id: test-javascript |
| 116 | + run: npx @github/local-action . src/main.js ../local-action/.env |
| 117 | + working-directory: javascript-action |
0 commit comments