-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lookup_table): ic, psycopg, xml. ci update (#1)
- Loading branch information
Showing
36 changed files
with
137 additions
and
605 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,49 +1,25 @@ | ||
name: Check pip compile sync | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-pip-compile: | ||
name: Check pip compile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
echo "python_version=$(python3 scripts/get_python_version.py)" >> "$GITHUB_OUTPUT" | ||
pip3 install --user uv | ||
id: get-python-version | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- uses: deargen/workflows/actions/check-pip-compile@master | ||
with: | ||
python-version: ${{ steps.get-python-version.outputs.python_version }} | ||
- name: Install uv | ||
run: | | ||
pip3 install uv | ||
- name: Generate lockfile and print diff | ||
run: | | ||
set +e # Do not exit shell on failure | ||
out=$(bash scripts/compile_requirements.sh 2> _stderr.txt) | ||
exit_code=$? | ||
err=$(<_stderr.txt) | ||
if [[ -n "$out" ]]; then | ||
# Display the raw output in the step | ||
echo "${out}" | ||
# Display the Markdown output in the job summary | ||
{ echo "\`\`\`"; echo "${out}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
fi | ||
if [[ -n "$err" ]]; then | ||
echo "${err}" | ||
{ echo "\`\`\`"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
fi | ||
if [[ $exit_code -eq 0 ]]; then | ||
# When the script fails, there are changes in requirements that are not compiled yet. | ||
# Print the suggested changes. | ||
{ echo "\`\`\`diff"; git diff; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
exit 1 | ||
fi | ||
# When the script fails, it means it does not have anything to compile. | ||
exit 0 | ||
pyproject-toml-file: pyproject.toml | ||
requirements-in-dir: deps | ||
requirements-out-dir: deps/lock | ||
python-platforms: x86_64-manylinux_2_28,aarch64-apple-darwin,x86_64-apple-darwin,x86_64-pc-windows-msvc |
This file contains 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 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 |
---|---|---|
@@ -1,67 +1,19 @@ | ||
name: Linting | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
ruff: | ||
name: ruff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
- name: Install ruff and requirements | ||
run: | | ||
pip3 install -r <(grep '^ruff==' deps/x86_64-unknown-linux-gnu/requirements_dev.txt) | ||
- name: Run ruff (code annotation) | ||
run: | | ||
set +e # Do not exit shell on ruff failure | ||
ruff check --output-format=github | ||
exit 0 | ||
- name: Run ruff (summary) | ||
run: | | ||
set +e # Do not exit shell on ruff failure | ||
nonzero_exit=0 | ||
files=$(find . -type f -name "*.py" | sort) | ||
while read -r file; do | ||
out=$(ruff check --force-exclude "$file" 2> ruff_stderr.txt) | ||
exit_code=$? | ||
err=$(<ruff_stderr.txt) | ||
if [[ $exit_code -ne 0 ]]; then | ||
nonzero_exit=$exit_code | ||
fi | ||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
if [[ -n "$out" ]]; then | ||
# Display the raw output in the step | ||
echo "${out}" | ||
# Display the Markdown output in the job summary | ||
{ echo "\`\`\`python"; echo "${out}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
fi | ||
if [[ -n "$err" ]]; then | ||
echo "${err}" | ||
{ echo "\`\`\`python"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
fi | ||
out=$(ruff check --diff --force-exclude "$file" 2> ruff_stderr.txt) | ||
err=$(<ruff_stderr.txt) | ||
if [[ -n "$out" ]]; then | ||
# Display the raw output in the step | ||
echo "${out}" | ||
# Display the Markdown output in the job summary | ||
{ echo "\`\`\`python"; echo "${out}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
fi | ||
if [[ -n "$err" ]]; then | ||
echo "${err}" | ||
{ echo "\`\`\`python"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY" | ||
fi | ||
done <<< "$files" | ||
# Exit with the first non-zero exit-code returned by ruff | ||
# or just zero if all passed | ||
exit ${nonzero_exit} | ||
jobs: | ||
ruff-lint: | ||
uses: deargen/workflows/.github/workflows/check-ruff.yml@master | ||
with: | ||
check-type: lint | ||
ruff-version-file: deps/lock/x86_64-manylinux_2_28/requirements_dev.txt |
Oops, something went wrong.