[WIP] Report Unit tests results #39
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: create-github-app-token/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: create-github-app-token | |
| - name: Run tests | |
| run: npm test | |
| working-directory: create-github-app-token | |
| - name: Publish Test Results | |
| uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 | |
| if: success() || failure() # run this step even if tests failed | |
| with: | |
| name: Jest Tests | |
| path: create-github-app-token/test-results/junit.xml | |
| reporter: jest-junit | |
| fail-on-error: true | |
| use-actions-summary: true | |
| - name: Publish Code Coverage Results | |
| uses: 5monkeys/cobertura-action@master | |
| if: success() || failure() # run this step even if tests failed | |
| with: | |
| path: create-github-app-token/coverage/cobertura-coverage.xml | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| minimum_coverage: 80 | |
| fail_below_threshold: false | |
| show_line: true | |
| show_branch: true | |
| show_class_names: true | |
| only_changed_files: false | |
| - name: Build | |
| run: npm run build | |
| working-directory: create-github-app-token | |
| - name: Package | |
| run: npm run package | |
| working-directory: create-github-app-token | |
| - name: Install tfx-cli | |
| run: npm install -g tfx-cli | |
| - name: Create Extension Package | |
| run: | | |
| tfx extension create \ | |
| --manifest-globs vss-extension.json \ | |
| --no-prompt \ | |
| --publisher ${PUBLISHER} | |
| env: | |
| PUBLISHER: ${{ vars.PUBLISHER || 'ENTER YOUR PUBLISHER HERE' }} | |
| - name: Upload Package to Artifacts | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: extension | |
| path: '*.vsix' |