add rust toolchain #3313
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 | |
# only run tests for pull requests cause no file has to be changed without review | |
# open -> open the pull request | |
# synchronize -> push to branch of pull request | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
test: | |
uses: ./.github/workflows/testing.yml | |
build-docs: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
sudo apt-get update && sudo apt-get -y install pandoc | |
pip install --upgrade pip wheel | |
pip install .[doc] | |
- name: build docs | |
run: | | |
cd doc | |
sphinx-apidoc -fT -o source/module_reference ../logprep | |
make clean html | |
code-quality: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: azure/[email protected] | |
with: | |
version: "latest" | |
id: install | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Get changed python files | |
id: changed-files | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
**/*.py | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install .[dev] | |
- name: check black formating | |
run: | | |
black --check --diff --config ./pyproject.toml . | |
- name: lint helm charts | |
run: | | |
helm lint --strict ./charts/logprep | |
- name: lint changed and added files | |
if: steps.changed-files.outputs.all_changed_files | |
run: | | |
pylint --rcfile=.pylintrc --fail-under 9.5 ${{ steps.changed-files.outputs.all_changed_files }} | |
- name: Run tests and collect coverage | |
run: pytest tests/unit --cov=logprep --cov-report=xml | |
- name: Upload coverage reports to Codecov with GitHub Action | |
uses: codecov/codecov-action@v2 | |
build_wheels: | |
name: Build wheels | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: "3.11" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS_LINUX: x86_64 aarch64 | |
CIBW_BUILD_LINUX: "cp310-* cp311-* cp312-*" | |
CIBW_SKIP_LINUX: "*pp* *i686*musl*" | |
CIBW_BEFORE_BUILD_LINUX: "curl -sSf https://sh.rustup.rs | sh -s -- -y" | |
CIBW_ENVIRONMENT: "PATH=$HOME/.cargo/bin:$PATH" | |
containerbuild: | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12.3"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build images | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true # Will only build if this is not here | |
build-args: | | |
LOGPREP_VERSION=dev | |
PYTHON_VERSION=${{ matrix.python-version }} | |
tags: | | |
ghcr.io/fkie-cad/logprep:py${{ matrix.python-version }}-${{ github.head_ref }} |