Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestfwilliams committed Jan 8, 2024
1 parent 2f8413f commit 71212b1
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 42 deletions.
1 change: 1 addition & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

jobs:
call-changelog-check-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Generate Test Coverage Report and Badge

on: pull_request

jobs:
pytest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml

- name: Generate Coverage Report and Badge
shell: bash -l {0}
run: |
python -m pip install --no-deps .
python -m pip install coverage-badge
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=hypelib tests/ | tee pytest-coverage.txt
coverage-badge -fo images/coverage.svg
- name: Commit Coverage Badge
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
add: 'images/coverage.svg'
message: 'update coverage image'

- name: PR Coverage Comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
1 change: 1 addition & 0 deletions .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ on:

jobs:
call-labeled-pr-check-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: Create Release Comment

on:
pull_request:
types:
- opened
branches:
- main

jobs:
call-release-checklist-workflow:
call-release-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
permissions:
pull-requests: write
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Write release and finish
name: Create Release

on:
push:
Expand All @@ -7,6 +7,7 @@ on:

jobs:
call-release-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
release_prefix: HyP3-lib
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@ name: Static analysis
on: push

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 flake8-import-order flake8-blind-except flake8-builtins
- name: Lint with flake8
run: |
flake8 --max-line-length=120 --import-order-style=pycharm --statistics \
--application-import-names hyp3lib --ignore=A,B,E,I,W,N8
call-secrets-analysis-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]

call-flake8-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
local_package_names: hyp3lib
6 changes: 5 additions & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tag version
name: Tag New Version

on:
push:
Expand All @@ -7,6 +7,10 @@ on:

jobs:
call-bump-version-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
user: tools-bot
email: [email protected]
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
36 changes: 36 additions & 0 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test and build

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
call-pytest-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
local_package_name: hyp3lib
python_versions: >-
["3.9", "3.10", "3.11", "3.12"]
call-version-info-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]

call-docker-ghcr-workflow:
needs: call-version-info-workflow
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
release_branch: main
develop_branch: develop
user: tools-bot
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 0 additions & 19 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit 71212b1

Please sign in to comment.