Bump actions/setup-python from 4 to 5 (#6) #140
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
name: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
release: | |
types: [published] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
Python: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout this Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
id: python-setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install Workflow Dependencies | |
run: python3 -m pip install build twine pre-commit -r tests/requirements.txt -r requirements.txt | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit_${{ steps.python-setup.outputs.python-version }}_${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Check formatting | |
run: pre-commit run --all-files | |
- name: Get test coverage | |
run: | | |
coverage run -m pytest | |
coverage report --format markdown >> $env:GITHUB_STEP_SUMMARY | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Create Distributions | |
run: python3 -m build | |
- name: twine Check | |
run: twine check dist/* | |
- name: twine Upload (pypi) | |
if: github.event_name == 'release' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
run: twine upload dist/* | |
- name: twine Upload (test-pypi) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} | |
run: twine upload --repository testpypi dist/* | |
Build: | |
if: github.event_name == 'push' && github.ref_name == 'master' | |
runs-on: windows-latest | |
steps: | |
- name: Checkout this Repo | |
uses: actions/checkout@v4 | |
# Runs a this repo's action | |
- name: Run Build action | |
id: builder | |
uses: 2bndy5/rmskin-action@master | |
with: | |
path: tests/demo_project | |
# Use the output from the `builder` step | |
- name: Print the output filename | |
run: echo "The output file was ${{ steps.builder.outputs.arc_name }}" |