Skip to content

Commit

Permalink
Merge pull request #41 from webis-de/patch-1
Browse files Browse the repository at this point in the history
Upstream changes
  • Loading branch information
janheinrichmerker authored Mar 5, 2024
2 parents 83ec503 + d1bbe27 commit 85b84bd
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 94 deletions.
14 changes: 11 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
- package-ecosystem: pip
directory: /
schedule:
interval: "weekly"
interval: weekly
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
172 changes: 82 additions & 90 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,173 +1,173 @@
name: "CI"
name: CI

on:
push:

jobs:
python-build:
name: "πŸ—οΈ Build Python wheels"
name: πŸ—οΈ Build Python wheels
strategy:
matrix:
python:
- "3.10"
- '3.10'
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "🧰 Install Protoc"
- name: 🧰 Install Protoc
run: sudo apt install protobuf-compiler
- name: "🧰 Install Python"
- name: 🧰 Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
- name: 🧰 Install dependencies
run: pip install build twine
- name: "πŸ—οΈ Build Python wheels"
- name: πŸ—οΈ Build Python wheels
run: python -m build
- name: "πŸ§ͺ Check package bundles"
- name: πŸ§ͺ Check package bundles
run: twine check dist/*
- name: "πŸ“€ Upload Python wheels"
- name: πŸ“€ Upload Python wheels
uses: actions/upload-artifact@v3
if: matrix.python == '3.10'
with:
name: wheels
path: dist
python-code-check:
name: "πŸ” Check Python code"
name: πŸ” Check Python code
strategy:
matrix:
python:
- "3.10"
- '3.10'
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "🧰 Install Protoc"
- name: 🧰 Install Protoc
run: sudo apt install protobuf-compiler
- name: "🧰 Install Python"
- name: 🧰 Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
- name: 🧰 Install dependencies
run: pip install .[tests]
- name: "πŸ” Check Python code"
- name: πŸ” Check Python code
run: ruff .
python-typing:
name: "πŸ” Check Python static typing"
name: πŸ” Check Python static typing
strategy:
matrix:
python:
- "3.10"
- '3.10'
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "🧰 Install Protoc"
- name: 🧰 Install Protoc
run: sudo apt install protobuf-compiler
- name: "🧰 Install Python"
- name: 🧰 Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
- name: 🧰 Install dependencies
run: pip install .[tests]
- name: "πŸ” Check Python static typing"
- name: πŸ” Check Python static typing
run: mypy .
python-security:
name: "πŸ” Check Python code security"
name: πŸ” Check Python code security
strategy:
matrix:
python:
- "3.10"
- '3.10'
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "🧰 Install Protoc"
- name: 🧰 Install Protoc
run: sudo apt install protobuf-compiler
- name: "🧰 Install Python"
- name: 🧰 Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
- name: 🧰 Install dependencies
run: pip install .[tests]
- name: "πŸ” Check Python code security"
- name: πŸ” Check Python code security
run: bandit -c pyproject.toml -r .
# python-test:
# name: "πŸ§ͺ Test Python code"
# strategy:
# matrix:
# python:
# - "3.10"
# runs-on: ubuntu-latest
# steps:
# - name: "πŸ“₯ Check-out"
# uses: actions/checkout@v3
# - name: "🧰 Install Protoc"
# run: sudo apt install protobuf-compiler
# - name: "🧰 Install Python"
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}
# cache: pip
# cache-dependency-path: pyproject.toml
# - name: "🧰 Install dependencies"
# run: pip install .[tests]
# - name: "πŸ§ͺ Test Python code"
# run: pytest --cov --cov-report=xml archive_query_log
# - name: "πŸ“€ Upload coverage to Codecov"
# uses: codecov/codecov-action@v3
# if: matrix.python == '3.10'
# with:
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}
python-test:
name: πŸ§ͺ Test Python code
strategy:
matrix:
python:
- '3.10'
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: 🧰 Install Protoc
run: sudo apt install protobuf-compiler
- name: 🧰 Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: 🧰 Install dependencies
run: pip install .[tests]
- name: πŸ§ͺ Test Python code
run: pytest --cov --cov-report=xml archive_query_log
- name: πŸ“€ Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.python == '3.10'
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
docker-build:
name: "πŸ—οΈ Build Docker image"
name: πŸ—οΈ Build Docker image
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "🧰 Set up QEMU"
- name: 🧰 Set up QEMU
uses: docker/setup-qemu-action@v2
- name: "🧰 Set up Docker Buildx"
- name: 🧰 Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: "πŸ—οΈ Build Docker image"
- name: πŸ—οΈ Build Docker image
uses: docker/build-push-action@v4
with:
context: .
push: false
python-publish:
name: "πŸš€ Publish Python wheels"
name: πŸš€ Publish Python wheels
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- python-build
- python-code-check
- python-typing
- python-security
# - python-test
- python-test
- docker-build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "πŸ“₯ Download Python wheels"
- name: πŸ“₯ Download Python wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: "πŸš€ Publish Python wheels"
- name: πŸš€ Publish Python wheels
uses: pypa/gh-action-pypi-publish@release/v1
docker-publish:
name: "πŸš€ Publish Docker image"
name: πŸš€ Publish Docker image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
permissions:
packages: write
Expand All @@ -176,65 +176,57 @@ jobs:
- python-code-check
- python-typing
- python-security
# - python-test
- python-test
- docker-build
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "🧰 Set up QEMU"
- name: 🧰 Set up QEMU
uses: docker/setup-qemu-action@v2
- name: "🧰 Set up Docker Buildx"
- name: 🧰 Set up Docker Buildx
uses: docker/setup-buildx-action@v2
#- name: "πŸ”‘ Login to Docker Hub"
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "πŸ”‘ Login to GitHub Packages"
- name: πŸ”‘ Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "ℹ️ Extract image metadata"
- name: ℹ️ Extract image metadata
id: meta
uses: docker/metadata-action@v4
with:
#images: |
# webis/archive-query-log
# ghcr.io/${{ github.repository }}
images: |
ghcr.io/${{ github.repository }}
- name: "πŸš€ Build and push image"
- name: πŸš€ Build and push image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
github-release:
name: "πŸš€ Create GitHub release"
name: πŸš€ Create GitHub release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- python-build
- python-code-check
- python-typing
- python-security
# - python-test
- python-test
- docker-build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Check-out"
- name: πŸ“₯ Check-out
uses: actions/checkout@v3
- name: "πŸ“₯ Download Python wheels"
- name: πŸ“₯ Download Python wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: "πŸš€ Create GitHub release"
- name: πŸš€ Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dynamic = ["version"]

[project.optional-dependencies]
tests = [
"approvaltests~=10.0",
"approvaltests~=11.0",
"bandit[toml]~=1.7",
"boto3-stubs[s3]~=1.28",
"mypy~=1.5",
Expand Down

0 comments on commit 85b84bd

Please sign in to comment.