Repository navigation
ci: scope the qlty-releases App token and gate it behind an environme… #485
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: Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: read | |
| jobs: | |
| test-install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install Dependencies (workspace root) | |
| run: npm ci --ignore-scripts | |
| - name: Build dist/ Directory | |
| working-directory: ./install | |
| run: npm run package | |
| - name: Compare Directories | |
| working-directory: ./install | |
| run: | | |
| if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then | |
| echo "Detected uncommitted changes after build. See status below:" | |
| git diff --ignore-space-at-eol --text dist/ | |
| exit 1 | |
| fi | |
| - name: Test | |
| working-directory: ./install | |
| run: npm run test | |
| test-fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| id: setup-node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install Dependencies (workspace root) | |
| run: npm ci --ignore-scripts | |
| - name: Build dist/ Directory | |
| working-directory: ./fmt | |
| run: npm run package | |
| - name: Compare Directories | |
| working-directory: ./fmt | |
| run: | | |
| if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then | |
| echo "Detected uncommitted changes after build. See status below:" | |
| git diff --ignore-space-at-eol --text dist/ | |
| exit 1 | |
| fi | |
| # - name: Test | |
| # id: npm-ci-test | |
| # working-directory: ./fmt | |
| # run: npm run ci-test | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install Dependencies (workspace root) | |
| run: npm ci --ignore-scripts | |
| - name: Build dist/ Directory | |
| working-directory: ./coverage | |
| run: npm run package | |
| - name: Compare Directories | |
| working-directory: ./coverage | |
| run: | | |
| if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then | |
| echo "Detected uncommitted changes after build. See status below:" | |
| git diff --ignore-space-at-eol --text dist/ | |
| exit 1 | |
| fi | |
| - name: Test | |
| working-directory: ./coverage | |
| run: npm run coverage | |
| - name: Upload coverage | |
| uses: qltysh/qlty-action/coverage@main | |
| with: | |
| oidc: true | |
| files: coverage/coverage/clover.xml | |
| - name: Verify clean working directory | |
| run: | | |
| if [ "$(git status --porcelain)" ]; then | |
| echo "Working directory is not clean. Please commit or stash your changes." | |
| git status | |
| exit 1 | |
| fi | |
| test-windows-coverage: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install Dependencies (workspace root) | |
| run: npm ci --ignore-scripts | |
| - name: Test | |
| working-directory: ./coverage | |
| run: npm run coverage | |
| - name: Upload coverage | |
| uses: qltysh/qlty-action/coverage@bh-windows-install | |
| with: | |
| files: coverage/coverage/clover.xml | |
| verbose: true | |
| skip-errors: false | |
| oidc: true |