split build from lint, try 3.10 as build arg

multiple-test-python-versions
dgtlmoon 6 months ago
parent bce02f9c82
commit db48cc64f5

@ -4,17 +4,10 @@ name: ChangeDetection.io App Test
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
test-application: lint-code:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# Mainly just for link/flake8
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Lint with flake8 - name: Lint with flake8
run: | run: |
pip3 install flake8 pip3 install flake8
@ -23,6 +16,18 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
test-application:
runs-on: ubuntu-latest
needs: lint-code
steps:
- uses: actions/checkout@v4
# Mainly just for link/flake8
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Spin up ancillary testable services - name: Spin up ancillary testable services
run: | run: |
@ -38,7 +43,7 @@ jobs:
- name: Build changedetection.io container for testing - name: Build changedetection.io container for testing
run: | run: |
# Build a changedetection.io container and start testing inside # Build a changedetection.io container and start testing inside
docker build --build-arg LOGGER_LEVEL=TRACE -t test-changedetectionio . docker build --build-arg PYTHON_VERSION=3.10 --build-arg LOGGER_LEVEL=TRACE -t test-changedetectionio .
# Debug info # Debug info
docker run test-changedetectionio bash -c 'pip list' docker run test-changedetectionio bash -c 'pip list'

@ -2,7 +2,10 @@
# @NOTE! I would love to move to 3.11 but it breaks the async handler in changedetectionio/content_fetchers/puppeteer.py # @NOTE! I would love to move to 3.11 but it breaks the async handler in changedetectionio/content_fetchers/puppeteer.py
# If you know how to fix it, please do! and test it for both 3.10 and 3.11 # If you know how to fix it, please do! and test it for both 3.10 and 3.11
FROM python:3.10-slim-bookworm as builder
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION}-slim-bookworm as builder
# See `cryptography` pin comment in requirements.txt # See `cryptography` pin comment in requirements.txt
ARG CRYPTOGRAPHY_DONT_BUILD_RUST=1 ARG CRYPTOGRAPHY_DONT_BUILD_RUST=1

Loading…
Cancel
Save