Skip to content

Update peter-evans/create-or-update-comment action to v5 #35

Update peter-evans/create-or-update-comment action to v5

Update peter-evans/create-or-update-comment action to v5 #35

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
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@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # 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@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # 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/