From ae2f21263e27f3b0b8061197e3569129c770e49f Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 14:47:56 +0200 Subject: [PATCH 1/7] update workflow --- .github/workflows/unit_tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 09e489949c..fc65402e0a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -41,6 +41,7 @@ jobs: - os: windows-latest python-version: '3.9.13' runs-on: ${{ matrix.os }} + # Service containers to run with `runner-job` services: # Label used to access the service container @@ -63,6 +64,8 @@ jobs: run-poetry-install: true create-venv-at-path: .venv - name: Run unit tests + # Run the macOS job only on merge to the main branch + if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') run: | export PYTHONUNBUFFERED=1 poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= @@ -74,6 +77,7 @@ jobs: poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= # Change to explicitly install v1 when reflex-hosting-cli is compatible with v2 - name: Run unit tests w/ pydantic v1 + if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') run: | export PYTHONUNBUFFERED=1 poetry run uv pip install "pydantic~=1.10" From 19b6bbffd1e1ef41d489577384297c704ce16e50 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 14:51:02 +0200 Subject: [PATCH 2/7] skip more in unit tests --- .github/workflows/unit_tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index fc65402e0a..3c026982f6 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -59,6 +59,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_build_env + if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') with: python-version: ${{ matrix.python-version }} run-poetry-install: true @@ -82,4 +83,7 @@ jobs: export PYTHONUNBUFFERED=1 poetry run uv pip install "pydantic~=1.10" poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= - - run: poetry run coverage html + - name: Generate coverage report + if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') + run: poetry run coverage html + From 908ea2524fd2f3c8421b67c697f558016c14019d Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 15:00:02 +0200 Subject: [PATCH 3/7] try something else to prevent adding macos job to pool --- .github/workflows/unit_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 3c026982f6..30d075ca80 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -35,6 +35,8 @@ jobs: python-version: '3.10.13' - os: windows-latest python-version: '3.9.18' + - os: macos-12 + if: github.event_name == 'push' && github.ref == 'refs/heads/main' include: - os: windows-latest python-version: '3.10.11' From 644fed33893b1c9c7c2c67025773a1b6362687ec Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 15:04:38 +0200 Subject: [PATCH 4/7] exclude too much --- .github/workflows/unit_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 30d075ca80..aa3c12d58e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -36,6 +36,7 @@ jobs: - os: windows-latest python-version: '3.9.18' - os: macos-12 + python-version: '3.12.0' if: github.event_name == 'push' && github.ref == 'refs/heads/main' include: - os: windows-latest From 74e324c9abc763e7b3231f7fa7262aa47953c5b0 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 15:11:06 +0200 Subject: [PATCH 5/7] fix units-text with macOS excluded --- .github/workflows/unit_tests.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index aa3c12d58e..d15e7f7f9b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest] python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] # Windows is a bit behind on Python version availability in Github exclude: @@ -37,7 +37,6 @@ jobs: python-version: '3.9.18' - os: macos-12 python-version: '3.12.0' - if: github.event_name == 'push' && github.ref == 'refs/heads/main' include: - os: windows-latest python-version: '3.10.11' @@ -62,14 +61,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_build_env - if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') with: python-version: ${{ matrix.python-version }} run-poetry-install: true create-venv-at-path: .venv - name: Run unit tests - # Run the macOS job only on merge to the main branch - if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') run: | export PYTHONUNBUFFERED=1 poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= @@ -81,12 +77,10 @@ jobs: poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= # Change to explicitly install v1 when reflex-hosting-cli is compatible with v2 - name: Run unit tests w/ pydantic v1 - if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') run: | export PYTHONUNBUFFERED=1 poetry run uv pip install "pydantic~=1.10" poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= - name: Generate coverage report - if: matrix.os != 'macos-12' || (github.event_name == 'push' && github.ref == 'refs/heads/main') run: poetry run coverage html From 4ee370685aa522e2bedb24282367a13150f0d4ee Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 15:12:33 +0200 Subject: [PATCH 6/7] also drop macOS job in integration tests --- .github/workflows/integration_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index e9fecc81a2..6d81cbbcff 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -42,7 +42,7 @@ jobs: fail-fast: false matrix: # Show OS combos first in GUI - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest] python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest @@ -122,7 +122,7 @@ jobs: fail-fast: false matrix: # Show OS combos first in GUI - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest] python-version: ['3.10.11', '3.11.4'] env: From 621723df2189a1fcb72de5ce76ef6a40be51ee19 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 9 Oct 2024 15:36:41 +0200 Subject: [PATCH 7/7] readd macos job separately to only run on merge --- .github/workflows/integration_tests.yml | 43 ++++++++++++++++++++++++- .github/workflows/unit_tests.yml | 26 +++++++++++++-- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 6d81cbbcff..106ac13839 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -161,4 +161,45 @@ jobs: poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}" --python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}" --pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}" - --app-name "reflex-web" --path ./reflex-web/.web \ No newline at end of file + --app-name "reflex-web" --path ./reflex-web/.web + + reflex-web-macos: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + strategy: + fail-fast: false + matrix: + python-version: ['3.11.5', '3.12.0'] + runs-on: macos-12 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: ${{ matrix.python-version }} + run-poetry-install: true + create-venv-at-path: .venv + - name: Clone Reflex Website Repo + uses: actions/checkout@v4 + with: + repository: reflex-dev/reflex-web + ref: main + path: reflex-web + - name: Install Requirements for reflex-web + working-directory: ./reflex-web + run: poetry run uv pip install -r requirements.txt + - name: Install additional dependencies for DB access + run: poetry run uv pip install psycopg2-binary + - name: Init Website for reflex-web + working-directory: ./reflex-web + run: poetry run reflex init + - name: Run Website and Check for errors + run: | + # Check that npm is home + npm -v + poetry run bash scripts/integration.sh ./reflex-web prod + - name: Measure and upload .web size + run: + poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}" + --python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}" + --pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}" + --app-name "reflex-web" --path ./reflex-web/.web + \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d15e7f7f9b..c769185833 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -35,8 +35,6 @@ jobs: python-version: '3.10.13' - os: windows-latest python-version: '3.9.18' - - os: macos-12 - python-version: '3.12.0' include: - os: windows-latest python-version: '3.10.11' @@ -84,3 +82,27 @@ jobs: - name: Generate coverage report run: poetry run coverage html + unit-tests-macos: + timeout-minutes: 30 + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + strategy: + fail-fast: false + matrix: + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] + runs-on: macos-12 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: ${{ matrix.python-version }} + run-poetry-install: true + create-venv-at-path: .venv + - name: Run unit tests + run: | + export PYTHONUNBUFFERED=1 + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= + - name: Run unit tests w/ pydantic v1 + run: | + export PYTHONUNBUFFERED=1 + poetry run uv pip install "pydantic~=1.10" + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= \ No newline at end of file