ci concurrency #19
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 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| format: | |
| name: Format | |
| runs-on: ubicloud-standard-2 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| - name: Install formatters | |
| uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 | |
| with: | |
| install: true | |
| cache: true | |
| install_args: "\"cargo:taplo-cli\" dprint" | |
| - name: Run formatters | |
| run: | | |
| mise format:ci | |
| lint: | |
| name: Lint | |
| runs-on: ubicloud-standard-2 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| - name: Install linters | |
| uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 | |
| with: | |
| install: true | |
| cache: true | |
| install_args: "\"cargo:taplo-cli\" \"npm:@infisical/cli\"" | |
| - name: Run linters | |
| run: | | |
| mise lint:ci --continue-on-error | |
| type-check: | |
| name: Type Check | |
| runs-on: ubicloud-standard-2 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| - name: Run Fast Type Check | |
| run: mise typecheck:ty | |
| - name: Add .venv/bin to PATH | |
| run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Run Slow Type Check | |
| uses: jakebailey/pyright-action@6cabc0f01c4994be48fd45cd9dbacdd6e1ee6e5e # v2 | |
| with: | |
| version: PATH | |
| project: ./pyrightconfig.json | |
| test: | |
| name: Test | |
| runs-on: ubicloud-standard-2 | |
| permissions: | |
| pull-requests: write | |
| issues: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| - name: Run tests | |
| if: ${{ github.event_name == 'pull_request'}} | |
| run: | | |
| mise run test:ci | |
| - name: Create test summary | |
| uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2 | |
| with: | |
| show: "all" | |
| paths: results/pytest-junit.xml | |
| output: pytest-summary.md | |
| if: ${{ github.event_name == 'pull_request' && !cancelled() }} | |
| - name: Wrap test summary in details | |
| if: ${{ github.event_name == 'pull_request' && !cancelled() }} | |
| run: | | |
| echo "<details>" > pytest-summary-wrapped.md | |
| echo "" >> pytest-summary-wrapped.md | |
| echo "<summary>Test Results</summary>" >> pytest-summary-wrapped.md | |
| echo "" >> pytest-summary-wrapped.md | |
| cat pytest-summary.md >> pytest-summary-wrapped.md | |
| echo "" >> pytest-summary-wrapped.md | |
| echo "</details>" >> pytest-summary-wrapped.md | |
| mv pytest-summary-wrapped.md pytest-summary.md | |
| - name: Update PR with test results | |
| uses: ./.github/actions/find-update-or-create-comment | |
| if: ${{ github.event_name == 'pull_request' && !cancelled() }} | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-includes: "Test Results" | |
| comment-author: "github-actions[bot]" | |
| body-path: pytest-summary.md | |
| edit-mode: replace | |
| - name: Run tests with coverage | |
| if: ${{ !cancelled() }} | |
| run: | | |
| mise run test:cov | |
| build: | |
| name: Build | |
| runs-on: ubicloud-standard-2 | |
| needs: [lint, type-check, test] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| - name: Build package | |
| run: | | |
| uv build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: dist | |
| path: dist/ |