Bump fakeredis from 2.23.2 to 2.23.3 in /zavod (#992) #3934
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: build | |
on: | |
- push | |
- pull_request | |
- workflow_dispatch | |
permissions: | |
packages: write | |
id-token: write | |
jobs: | |
python: | |
env: | |
OPENSANCTIONS_RESOLVER_PATH: /dev/null | |
ZAVOD_SYNC_POSITIONS: false | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: | |
- "3.10" | |
- "3.11" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: "pip" | |
- name: Install system dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get install -y -qq libicu-dev poppler-utils | |
- name: Install zavod dependencies | |
working-directory: zavod | |
run: | | |
pip install --no-cache-dir -q -e ".[dev]" | |
pip freeze | |
- name: Check zavod type annotations (strict) | |
working-directory: zavod | |
run: | | |
make typecheck | |
- name: Check zavod ruff lint | |
working-directory: zavod | |
run: | | |
make lint | |
- name: Run zavod tests | |
working-directory: zavod | |
run: | | |
make test | |
- name: Build a zavod distribution | |
working-directory: zavod | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Get any modified dataset files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: "datasets/**" | |
- name: Crawl modified datasets | |
if: ${{ steps.changed-files.outputs.all_changed_files != '' }} | |
run: | | |
set -euo pipefail | |
datasets=$(python contrib/ci_datasets.py ${{ steps.changed-files.outputs.all_changed_files }}) | |
echo "$datasets" | |
for dataset in $datasets | |
do | |
echo Crawling $dataset | |
zavod crawl -c $dataset | |
done | |
- name: Validate modified datasets | |
if: ${{ steps.changed-files.outputs.all_changed_files != '' }} | |
run: | | |
set -euo pipefail | |
datasets=$(python contrib/ci_datasets.py ${{ steps.changed-files.outputs.all_changed_files }}) | |
for dataset in $datasets | |
do | |
echo Validating $dataset | |
zavod validate -c $dataset | |
done | |
- name: Export modified datasets | |
if: ${{ steps.changed-files.outputs.all_changed_files != '' }} | |
run: | | |
set -euo pipefail | |
datasets=$(python contrib/ci_datasets.py ${{ steps.changed-files.outputs.all_changed_files }}) | |
for dataset in $datasets | |
do | |
echo Exporting $dataset | |
zavod export -c $dataset | |
done | |
- name: Publish a Python distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
# working-directory: zavod | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/zavod') | |
with: | |
skip-existing: true | |
packages-dir: zavod/dist | |
docker: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: [python] | |
steps: | |
- uses: actions/checkout@v4 | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push release | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
pull: true | |
push: true | |
tags: ghcr.io/opensanctions/opensanctions:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
dispatch: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: [docker, python] | |
steps: | |
- name: Dispatch add-on build | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.OPERATIONS_PAT }} | |
repository: opensanctions/operations | |
event-type: build-etl |