chore(deps): update actions/checkout action to v4.2.0 #1426
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 | |
on: [push] | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
#- "3.12" | |
# Service containers to run | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # fetch all history | |
- name: Apt update | |
run: sudo apt-get update | |
- name: Apt install | |
run: sudo apt-get install -y libxmlsec1-dev | |
- uses: eifinger/setup-rye@v4 | |
id: setup-rye | |
- name: Pin python-version ${{ matrix.python-version }} | |
run: rye pin ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: rye sync | |
- name: Tests | |
run: rye test | |
- name: Changelog | |
if: ${{ !contains(github.event.head_commit.author, 'renovate') }} | |
run: rye run build changelog check | |
# - name: Upload coverage to CodeCov | |
# uses: codecov/codecov-action@v1 | |
# with: | |
# directory: ${{ matrix.app-name }}/coverage/ | |
# flags: ${{ matrix.app-name }} | |
release: | |
needs: tests | |
runs-on: ubuntu-22.04 | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-rye@v4 | |
id: setup-rye | |
# extract the app name out of the tag's ref value | |
- id: get-app-name | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const appName = context.ref.match(/refs\/tags\/([a-z\-]+)\/v\S+$/)[1] | |
core.setOutput('app-name', appName) | |
core.setOutput('app-package', appName.replace("mitol-django-", "").replace(/-/g, "_")) | |
- name: Build | |
run: rye build "src/${{steps.get-app-name.outputs.app-package}}:" | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |