diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87ed88c..ead1b6e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ env: jobs: - unit-tests-no-common-sql: + unit-tests: runs-on: ubuntu-latest strategy: matrix: @@ -46,6 +46,11 @@ jobs: airflow-version: "2.4.3" - python-version: "3.11" airflow-version: "2.5.3" + include: + - airflow-extras: "[common.sql]" + tests-pattern: "" + - airflow-extras: "" + tests-pattern: "-p test_clickhouse.py" steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -57,57 +62,14 @@ jobs: python -m pip install --upgrade pip python -m pip install \ -r requirements.txt \ - apache-airflow==${{ matrix.airflow-version }} \ + apache-airflow${{ matrix.airflow-extras }}==${{ matrix.airflow-version }} \ --ignore-installed \ --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt" - name: Run unit tests run: | - python -m unittest discover -t tests -s unit -p test_clickhouse.py + python -m unittest discover -t tests -s unit ${{ matrix.tests-pattern }} - unit-tests-common-sql: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - airflow-version: ["2.1.4", "2.2.5", "2.3.4", "2.4.3", "2.5.3", "2.6.3", "2.7.1"] - exclude: - - python-version: "3.10" - airflow-version: "2.0.2" - - python-version: "3.10" - airflow-version: "2.1.4" - - python-version: "3.10" - airflow-version: "2.2.5" - - python-version: "3.11" - airflow-version: "2.0.2" - - python-version: "3.11" - airflow-version: "2.1.4" - - python-version: "3.11" - airflow-version: "2.2.5" - - python-version: "3.11" - airflow-version: "2.3.4" - - python-version: "3.11" - airflow-version: "2.4.3" - - python-version: "3.11" - airflow-version: "2.5.3" - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install \ - -r requirements.txt \ - apache-airflow[common.sql]==${{ matrix.airflow-version }} \ - --ignore-installed \ - --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt" - - name: Run unit tests - run: | - python -m unittest discover -t tests -s unit - - integration-tests-no-common-sql: + integration-tests: runs-on: ubuntu-latest strategy: matrix: @@ -132,6 +94,11 @@ jobs: airflow-version: "2.4.3" - python-version: "3.11" airflow-version: "2.5.3" + include: + - airflow-extras: "[common.sql]" + tests-pattern: "" + - airflow-extras: "" + tests-pattern: "-p test_clickhouse.py" services: clickhouse: image: yandex/clickhouse-server @@ -148,61 +115,11 @@ jobs: python -m pip install --upgrade pip python -m pip install \ -r requirements.txt \ - apache-airflow==${{ matrix.airflow-version }} \ - --ignore-installed \ - --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt" - - name: Run tests on ClickHouse server - env: - AIRFLOW_CONN_CLICKHOUSE_DEFAULT: "clickhouse://localhost:${{ job.services.clickhouse.ports['9000'] }}" - run: | - python -m unittest discover -t tests -s integration -p test_clickhouse.py - - integration-tests-common-sql: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - airflow-version: ["2.1.4", "2.2.5", "2.3.4", "2.4.3", "2.5.3", "2.6.3", "2.7.1"] - exclude: - - python-version: "3.10" - airflow-version: "2.0.2" - - python-version: "3.10" - airflow-version: "2.1.4" - - python-version: "3.10" - airflow-version: "2.2.5" - - python-version: "3.11" - airflow-version: "2.0.2" - - python-version: "3.11" - airflow-version: "2.1.4" - - python-version: "3.11" - airflow-version: "2.2.5" - - python-version: "3.11" - airflow-version: "2.3.4" - - python-version: "3.11" - airflow-version: "2.4.3" - - python-version: "3.11" - airflow-version: "2.5.3" - services: - clickhouse: - image: yandex/clickhouse-server - ports: - - 9000/tcp - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install \ - -r requirements.txt \ - apache-airflow[common.sql]==${{ matrix.airflow-version }} \ + apache-airflow${{ matrix.airflow-extras }}==${{ matrix.airflow-version }} \ --ignore-installed \ --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt" - name: Run tests on ClickHouse server env: AIRFLOW_CONN_CLICKHOUSE_DEFAULT: "clickhouse://localhost:${{ job.services.clickhouse.ports['9000'] }}" run: | - python -m unittest discover -t tests -s integration + python -m unittest discover -t tests -s integration ${{ matrix.tests-pattern }}