diff --git a/.github/changes-filter.yaml b/.github/changes-filter.yaml new file mode 100644 index 000000000..f3df3db58 --- /dev/null +++ b/.github/changes-filter.yaml @@ -0,0 +1,15 @@ +# https://github.com/dorny/paths-filter +python: + - "src/backend/**" + - "src/backend/**.py" + - "pyproject.toml" + - "poetry.lock" + - "**/python_test.yml" +tests: + - "tests/**" + - "src/frontend/tests/**" +frontend: + - "src/frontend/**" + - "**/typescript_test.yml" +docs: + - "docs/**" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f00a30efe..a0b04d5a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,6 @@ on: type: string pull_request: - - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -42,21 +40,7 @@ jobs: id: filter uses: dorny/paths-filter@v3 with: - filters: | - python: - - "src/backend/**" - - "src/backend/**.py" - - "pyproject.toml" - - "poetry.lock" - - "**/python_test.yml" - tests: - - "tests/**" - - "src/frontend/tests/**" - frontend: - - "src/frontend/**" - - "**/typescript_test.yml" - docs: - - "docs/**" + filters: ./.github/changes-filter.yaml test-backend: needs: path-filter diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index 5e06e0003..1aa4d848e 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -11,7 +11,6 @@ on: env: POETRY_VERSION: "1.8.2" - jobs: build: name: Run Unit Tests diff --git a/.github/workflows/scheduled_integration_test.yml b/.github/workflows/scheduled_integration_test.yml new file mode 100644 index 000000000..627f512fc --- /dev/null +++ b/.github/workflows/scheduled_integration_test.yml @@ -0,0 +1,59 @@ +name: Integration tests + +on: + workflow_dispatch: + inputs: + branch: + description: "(Optional) Branch to checkout" + required: false + type: string + schedule: + - cron: "0 0 */2 * *" # Run every 2 days + +env: + POETRY_VERSION: "1.8.2" + +jobs: + setup-environment: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.12" + - "3.11" + - "3.10" + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch || github.ref }} + - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_caching" + with: + python-version: ${{ matrix.python-version }} + poetry-version: ${{ env.POETRY_VERSION }} + cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} + - name: Install Python dependencies + run: | + poetry env use ${{ matrix.python-version }} + poetry install + + test-integration: + needs: setup-environment + name: Run Integration Tests + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.12" + - "3.11" + - "3.10" + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + ASTRA_DB_API_KEY: ${{ secrets.ASTRA_DB_API_KEY }} + ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }} + steps: + - name: Run integration tests + timeout-minutes: 12 + run: | + make integration_tests