[sc-2887] GX Crawler #2350
Workflow file for this run
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 | |
env: | |
PYTHON_VERSION: 3.9 | |
POETRY_VERSION: 1.8.3 | |
# Run this build workflow for every new PR | |
on: | |
pull_request: | |
branches: [main] | |
merge_group: | |
permissions: | |
contents: read | |
pull-requests: write | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
check-py: | |
name: Check Python code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Setup Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Setup dev libs | |
run: | | |
sudo apt-get install libsasl2-dev libpq-dev | |
- name: Lint & Type Check | |
run: | | |
poetry install -E all | |
poetry run flake8 | |
poetry run black --check . | |
poetry run isort --check . | |
poetry run mypy . --explicit-package-bases | |
poetry run bandit -r . -c pyproject.toml | |
- name: Test | |
run: | | |
poetry run coverage run -m pytest | |
poetry run coverage xml | |
- name: Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Pytest coverage comment | |
uses: orgoro/coverage@v3 | |
with: | |
coverageFile: ./coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
thresholdAll: 0.85 | |
thresholdNew: 0.85 | |
thresholdModified: 0.0 | |
- name: Check bumped version | |
run: bash .github/scripts/check_version.sh | |
docker: | |
name: Docker build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Setup Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Export requirements.txt | |
run: poetry export -E all -f requirements.txt --output requirements.txt | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: false |