Temporary Deployment #62
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: Pull Request Validation | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - closed | |
| concurrency: preview-${{ github.ref }} | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| commit-validator: | |
| name: Commit Validator | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate Commit Messages | |
| uses: zjuDBSystems/commit-message-validator@v1.0.0 | |
| build-tool: | |
| name: Build AnNER Tool Preview | |
| runs-on: ubuntu-latest | |
| needs: commit-validator | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.MODIFIED_GITHUB_TOKEN }} | |
| - name: Install pnpm and dependencies | |
| uses: pnpm/action-setup@v2 | |
| id: pnpm-install | |
| if: github.event.action != 'closed' | |
| with: | |
| version: 8.5.0 | |
| run_install: false | |
| - name: Install | |
| run: pnpm install | |
| if: github.event.action != 'closed' | |
| - name: Build | |
| run: pnpm vite build --base=/AnNER/pr-preview/pr-${{ github.event.number }}/ | |
| if: github.event.action != 'closed' | |
| - name: Deploy preview | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: dist/ | |
| preview-branch: deployment | |
| token: ${{ secrets.MODIFIED_GITHUB_TOKEN }} | |
| run-coverage: | |
| name: Run Coverage | |
| runs-on: ubuntu-latest | |
| needs: commit-validator | |
| permissions: | |
| # Required to checkout the code | |
| contents: read | |
| # Required to put a comment into the pull-request | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Setup PNPM Package Manager | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.5.2 | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run Coverage | |
| run: npx vitest --coverage.enabled --coverage.provider=v8 --coverage.reporter=json-summary --coverage.reporter=json | |
| - name: 'Report Coverage' | |
| if: always() | |
| uses: davelosert/vitest-coverage-report-action@v2 |