-
Notifications
You must be signed in to change notification settings - Fork 563
ci: add lint workflow and unify coverage reporting #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5b3843f
ci: add lint workflow and unify coverage reporting
Pouyanpi d1aec4c
ci: broaden path-ignore for GitHub workflows
Pouyanpi a30bcf0
lint for every PR
Pouyanpi 351a966
chore(ci): skip tests for docs and workflow changes
Pouyanpi 5195ecb
simplify
Pouyanpi dcfade3
ci: inherit secrets in PR test workflow
Pouyanpi 5cff249
rename
Pouyanpi cecbebc
simplify style
Pouyanpi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| POETRY_VERSION: 1.8.2 | ||
| PYTHON_VERSION: "3.11" | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint Code | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
|
||
| - name: Get full Python version | ||
| id: full-python-version | ||
| run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Bootstrap poetry | ||
| run: | | ||
| curl -sSL https://install.python-poetry.org | POETRY_VERSION=${{ env.POETRY_VERSION }} python - | ||
| echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Configure poetry | ||
| run: poetry config virtualenvs.in-project true | ||
|
|
||
| - name: Set up cache | ||
| uses: actions/cache@v4 | ||
| id: cache | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Ensure cache is healthy | ||
| if: steps.cache.outputs.cache-hit == 'true' | ||
| run: timeout 10s poetry run pip --version || rm -rf .venv | ||
|
|
||
| - name: Install dependencies | ||
| run: poetry install --with dev | ||
|
|
||
| - name: Run pre-commit hooks | ||
| run: poetry run make pre_commit |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| name: Skip PR Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/*.md" | ||
| - ".github/**" | ||
Pouyanpi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| jobs: | ||
| pr-tests-summary: | ||
| name: PR Tests Summary | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - run: echo "Tests skipped (no code changes)" | ||
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
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.