From 8660dc9d3ed6953622db37fe90ac4c0e73465e23 Mon Sep 17 00:00:00 2001 From: Pankaj Date: Wed, 7 Aug 2024 18:42:38 +0530 Subject: [PATCH] Fix --- .github/workflows/test.yml | 112 ++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 59 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 657b1cf..f71ab4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,25 +17,25 @@ jobs: steps: - run: true -# Static-Check: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# with: -# ref: ${{ github.event.pull_request.head.sha || github.ref }} -# - uses: actions/setup-python@v4 -# with: -# python-version: "3.11" -# architecture: "x64" -# - run: pip3 install hatch -# - run: hatch run tests.py3.11-2.9:static-check + Static-Check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + architecture: "x64" + - run: pip3 install hatch + - run: hatch run tests.py3.11-2.9:static-check Run-Unit-Tests: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12"] - airflow-version: ["2.9"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + airflow-version: ["2.7", "2.8", "2.9"] exclude: - python-version: "3.12" airflow-version: "2.7" @@ -72,57 +72,51 @@ jobs: with: name: coverage-unit-test-${{ matrix.python-version }}-${{ matrix.airflow-version }} path: .coverage -# - name: Upload coverage reports to Codecov -# uses: codecov/codecov-action@v4.0.1 -# with: -# name: coverage-unit-test-${{ matrix.python-version }}-${{ matrix.airflow-version }} -# path: .coverage -# token: ${{ secrets.CODECOV_TOKEN }} -# Run-Integration-Tests: -# needs: Authorize -# runs-on: ubuntu-latest -# strategy: -# matrix: -# python-version: ["3.11"] -# airflow-version: ["2.9"] -# steps: -# - uses: actions/checkout@v4 -# with: -# ref: ${{ github.event.pull_request.head.sha || github.ref }} -# - uses: actions/cache@v4 -# with: -# path: | -# ~/.cache/pip -# .nox -# key: integration-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('anyscale_provider/__init__.py') }} -# -# - name: Set up Python ${{ matrix.python-version }} -# uses: actions/setup-python@v4 -# with: -# python-version: ${{ matrix.python-version }} -# -# - name: Install packages and dependencies -# run: | -# python -m pip install hatch -# hatch -e tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }} run pip freeze -# -# - name: Test Anyscale against Airflow ${{ matrix.airflow-version }} and Python ${{ matrix.python-version }} -# run: | -# hatch run tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}:test-integration -# env: -# ANYSCALE_CLI_TOKEN: ${{ secrets.ANYSCALE_CLI_TOKEN }} -# - name: Upload coverage to Github -# uses: actions/upload-artifact@v4 -# with: -# name: coverage-integration-test-${{ matrix.python-version }}-${{ matrix.airflow-version }} -# path: coverage/*.coverage + Run-Integration-Tests: + needs: Authorize + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + airflow-version: ["2.9"] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + .nox + key: integration-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('anyscale_provider/__init__.py') }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install packages and dependencies + run: | + python -m pip install hatch + hatch -e tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }} run pip freeze + + - name: Test Anyscale against Airflow ${{ matrix.airflow-version }} and Python ${{ matrix.python-version }} + run: | + hatch run tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}:test-integration + env: + ANYSCALE_CLI_TOKEN: ${{ secrets.ANYSCALE_CLI_TOKEN }} + - name: Upload coverage to Github + uses: actions/upload-artifact@v4 + with: + name: coverage-integration-test-${{ matrix.python-version }}-${{ matrix.airflow-version }} + path: .coverage Code-Coverage: if: github.event.action != 'labeled' needs: - Run-Unit-Tests - # - Run-Integration-Tests + - Run-Integration-Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v3