Skip to content
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

Add zizmor pre-commit hook #361

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/nb_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -82,18 +84,22 @@ jobs:
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}
REPOSITORY: ${{ github.repository }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
'${REF_NAME}'
--repo '${REPOSITORY}'
--generate-notes
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}
REPOSITORY: ${{ github.repository }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
'${REF_NAME}' dist/**
--repo '${REPOSITORY}'
build-for-prefix:
name: Build prefix package
Expand All @@ -104,13 +110,17 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Download the built dist
uses: actions/download-artifact@v4
with:
name: pip-dist
path: dist/
- name: Add tag to recipe
run: sed -i "s/TAG_VERSION/${{ github.ref_name }}/g" publish/recipes/release/ecoscope.yaml
env:
REF_NAME: ${{ github.ref_name }}
run: sed -i "s/TAG_VERSION/${REF_NAME}/g" publish/recipes/release/ecoscope.yaml
- name: Add dist to recipe
run: sed -i "s/DIST_NAME/$(find ./dist/*.tar.gz -printf "%f\n")/g" publish/recipes/release/ecoscope.yaml
- name: Log the generated recipe
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Micromamba
uses: mamba-org/[email protected]
Expand All @@ -40,8 +42,9 @@ jobs:
ER_PASSWORD: ${{ secrets.ER_PASSWORD }}
EE_ACCOUNT: ${{ secrets.EE_ACCOUNT }}
EE_PRIVATE_KEY_DATA: ${{ secrets.EE_PRIVATE_KEY_DATA }}
INPUT_IO: ${{inputs.io}}
run: |
pytest -v -r s -m "${{ inputs.io }}" --color=yes --cov=ecoscope --cov-append --cov-report=xml
pytest -v -r s -m "${INPUT_IO}" --color=yes --cov=ecoscope --cov-append --cov-report=xml
- name: Codecov
uses: codecov/codecov-action@v5
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ repos:
args: ['--ignore=E203,E402,W503', '--max-line-length=120']
#- id: nbqa-isort
#args: ['-m3', '--tc']
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v0.9.1
hooks:
- id: zizmor

exclude: ^ecoscope/contrib/
Loading