Skip to content

Commit

Permalink
fix: github workflows (#12)
Browse files Browse the repository at this point in the history
* chore: update release workflow actions

* chore: update pr workflow actions

* chore: update pipeline workflow actions

* fix: pipeline workflow pre-commit step
  • Loading branch information
shawalli authored Apr 10, 2021
1 parent 02142e4 commit a6fa6b6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: Checkout master and PR branch
run: |
git fetch --no-tags --depth=1 origin +refs/heads/${{ github.base_ref }}
git fetch --no-tags --depth=1 origin ${{ github.sha }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
uses: dschep/install-poetry-action@v1.3
uses: snok/install-poetry@v1.1.2
with:
create_virtualenvs: true
virtualenvs-create: true

- name: Cache Poetry virtualenv
uses: actions/cache@v2
Expand All @@ -53,9 +58,7 @@ jobs:

- name: Run pre-commit
if: github.event_name == 'pull_request'
run: |
git fetch origin master:master
poetry run pre-commit run --from-ref master --to-ref HEAD
run: poetry run pre-commit run --show-diff-on-failure --files $(git diff --name-only --no-ext-diff -z origin/master..HEAD)

test:
name: 🧪
Expand Down Expand Up @@ -92,9 +95,9 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install poetry
uses: dschep/install-poetry-action@v1.3
uses: snok/install-poetry@v1.1.2
with:
create_virtualenvs: true
virtualenvs-create: true

- name: Cache Poetry virtualenv
uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
name: 👪
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/[email protected].1
- uses: kentaro-m/[email protected].2
17 changes: 7 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:

- name: Get next package version
id: bumpversion
uses: anothrNick/github-tag-action@1.23.0
uses: anothrNick/github-tag-action@1.35.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DRY_RUN: true

- name: Install poetry
uses: dschep/install-poetry-action@v1.3
uses: snok/install-poetry@v1.1.2
with:
create_virtualenvs: true
virtualenvs-create: true

- name: Bump release version
run: poetry version ${{ steps.bumpversion.outputs.new_tag }}
Expand Down Expand Up @@ -62,12 +62,9 @@ jobs:
echo "::set-output name=message::$NOTES_ENCODED_NEWLINES"
- name: Create release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/[email protected]
with:
tag_name: ${{ steps.bumpversion.outputs.new_tag }}
release_name: ${{ steps.bumpversion.outputs.new_tag }}
token: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ github.event.push.ref }}
tag: ${{ steps.bumpversion.outputs.new_tag }}
body: ${{ steps.release_message.outputs.message}}
draft: false
prerelease: false

0 comments on commit a6fa6b6

Please sign in to comment.