|
| 1 | +name: Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + models: read |
| 14 | + |
| 15 | +jobs: |
| 16 | + test-typescript: |
| 17 | + name: TypeScript Tests |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + id: checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Setup Node.js |
| 26 | + id: setup-node |
| 27 | + uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version-file: .node-version |
| 30 | + cache: npm |
| 31 | + |
| 32 | + - name: Install Dependencies |
| 33 | + id: npm-ci |
| 34 | + run: npm ci |
| 35 | + |
| 36 | + - name: Check Format |
| 37 | + id: npm-format-check |
| 38 | + run: npm run format:check |
| 39 | + |
| 40 | + - name: Lint |
| 41 | + id: npm-lint |
| 42 | + run: npm run lint |
| 43 | + |
| 44 | + - name: Test |
| 45 | + id: npm-ci-test |
| 46 | + run: npm run ci-test |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ github.token }} |
| 49 | + |
| 50 | + test-action: |
| 51 | + name: GitHub Actions Test |
| 52 | + runs-on: ubuntu-latest |
| 53 | + |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + id: checkout |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Test Local Action |
| 60 | + id: test-action |
| 61 | + continue-on-error: true |
| 62 | + uses: ./ |
| 63 | + with: |
| 64 | + prompt: hello |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ github.token }} |
| 67 | + |
| 68 | + - name: Print Output |
| 69 | + id: output |
| 70 | + continue-on-error: true |
| 71 | + run: echo "${{ steps.test-action.outputs.response }}" |
| 72 | + |
| 73 | + test-action-prompt-file: |
| 74 | + name: GitHub Actions Test with Prompt File |
| 75 | + runs-on: ubuntu-latest |
| 76 | + |
| 77 | + steps: |
| 78 | + - name: Checkout |
| 79 | + id: checkout |
| 80 | + uses: actions/checkout@v4 |
| 81 | + |
| 82 | + - name: Create Prompt File |
| 83 | + run: echo "hello" > prompt.txt |
| 84 | + |
| 85 | + - name: Create System Prompt File |
| 86 | + run: |
| 87 | + echo "You are a helpful AI assistant for testing." > system-prompt.txt |
| 88 | + |
| 89 | + - name: Test Local Action with Prompt File |
| 90 | + id: test-action-prompt-file |
| 91 | + continue-on-error: true |
| 92 | + uses: ./ |
| 93 | + with: |
| 94 | + prompt-file: prompt.txt |
| 95 | + system-prompt-file: system-prompt.txt |
| 96 | + env: |
| 97 | + GITHUB_TOKEN: ${{ github.token }} |
| 98 | + |
| 99 | + - name: Print Output |
| 100 | + continue-on-error: true |
| 101 | + run: | |
| 102 | + echo "Response saved to: ${{ steps.test-action-prompt-file.outputs.response-file }}" |
| 103 | + cat "${{ steps.test-action-prompt-file.outputs.response-file }}" |
0 commit comments