Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: CI

on:
# Since this same workflow file is used for both PRs and pushes,
# Zizmor wants to flag all uses of caches as potential cache poisoning vulnerabilities.
# I don't see a way to easily split this workflow into two separate files since
# we do want to build the package for PRs, and then publish it from that exact
# built artifact, if we're pushing to tags.

on: # zizmor: ignore[cache-poisoning]
push:
branches:
- master
Expand All @@ -12,14 +18,19 @@ on:
- master
- '*-maint'

permissions: {}

jobs:
lint:
name: lint
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@eb1897b8dc4b5d5bfe39a428a8f2304605e0983c # v7.0.0
with:
cache-dependency-glob: ".github/workflows/*.yml"
cache-suffix: pre-commit-uv
Expand All @@ -32,6 +43,7 @@ jobs:
env:
RUFF_OUTPUT_FORMAT: github
test:
name: test
permissions:
contents: read
runs-on: ${{ matrix.os }}
Expand All @@ -56,6 +68,8 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/cache@v4
with:
path: cldr
Expand All @@ -76,19 +90,22 @@ jobs:
env:
COVERAGE_XML_PATH: ${{ runner.temp }}
BABEL_TOX_EXTRA_DEPS: pytest-github-actions-annotate-failures
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
directory: ${{ runner.temp }}
flags: ${{ matrix.os }}-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
build:
name: build
permissions:
contents: read
runs-on: ubuntu-24.04
needs: lint
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: "3.14"
Expand All @@ -102,6 +119,7 @@ jobs:
name: dist
path: dist
publish:
name: publish
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- build
Expand All @@ -110,14 +128,14 @@ jobs:
name: release
url: https://pypi.org/p/babel/
permissions:
id-token: write
id-token: write # Required for Trusted Publishing action
steps:
- uses: actions/download-artifact@v5
with:
name: dist
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
verbose: true
print-hash: true
Loading