Skip to content

Commit

Permalink
Update workflow action versions and badges (#61)
Browse files Browse the repository at this point in the history
* Bump actions/checkout to v4

* Bump actions/setup-python to v5

* Bump actions/cache to v4

* Bump mikepenz/release-changelog-builder-action to v4

* Rename cache action

* Update workflows to only create badges on main
  • Loading branch information
jessicasyu committed Jun 5, 2024
1 parent 85d9c2a commit dea2b40
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 27 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -26,15 +26,15 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
- name: Cache environment
id: cached-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
clean: false

result:
if: ${{ always() }}
if: ${{ always() && github.ref == 'refs/heads/main' }}

runs-on: ubuntu-latest

Expand All @@ -92,7 +92,7 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get build result
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand All @@ -25,15 +25,15 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
- name: Cache environment
id: cached-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
Expand Down
34 changes: 27 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand All @@ -22,15 +22,15 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
- name: Cache environment
id: cached-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
Expand All @@ -54,6 +54,26 @@ jobs:
source .venv/bin/activate
mypy src
result:
if: ${{ always() && github.ref == 'refs/heads/main' }}

runs-on: ubuntu-latest

needs: [lint]

steps:

- name: Checkout the repo
uses: actions/checkout@v4

- name: Get lint result
run: |
if [[ ${{ needs.lint.result }} == "success" || ${{ needs.lint.result }} == "skipped" ]]; then
exit 0
else
exit 1
fi
- name: Generate passing badge
if: success()
uses: knightdave/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Extract version from branch name
run: |
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
body: ${{ steps.build_changelog.outputs.changelog }}

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Extract version from branch name
run: |
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3.4.0
uses: mikepenz/release-changelog-builder-action@v4
with:
configurationJson: |
{
Expand Down

0 comments on commit dea2b40

Please sign in to comment.