From e2f4510faa6de24325c60fbc5761c54f45044ed2 Mon Sep 17 00:00:00 2001 From: baogorek Date: Thu, 17 Jul 2025 14:29:04 -0400 Subject: [PATCH 1/6] manual test --- .github/workflows/manual_code_changes.yaml | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/manual_code_changes.yaml diff --git a/.github/workflows/manual_code_changes.yaml b/.github/workflows/manual_code_changes.yaml new file mode 100644 index 00000000..0817930e --- /dev/null +++ b/.github/workflows/manual_code_changes.yaml @@ -0,0 +1,43 @@ +# Workflow that runs on code changes after merge to main. + +name: Manual Testing +on: + workflow_dispatch: + +env: + HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} + POLICYENGINE_US_DATA_GITHUB_TOKEN: ${{ secrets.POLICYENGINE_US_DATA_GITHUB_TOKEN }} + +jobs: + Test: + permissions: + contents: "read" + # Required to auth against gcp + id-token: "write" + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + - uses: "google-github-actions/auth@v2" + with: + workload_identity_provider: "projects/322898545428/locations/global/workloadIdentityPools/policyengine-research-id-pool/providers/prod-github-provider" + service_account: "policyengine-research@policyengine-research.iam.gserviceaccount.com" + - name: Install package + run: uv pip install -e .[dev] --system + - name: Test documentation builds + run: make documentation + - name: Deploy documentation + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: docs/_build/html # The folder the action should deploy. + CLEAN: true # Optionally delete the contents of the release branch before deploying.jk + From ce7106b81af47951f1db955238d541f84017c0b9 Mon Sep 17 00:00:00 2001 From: baogorek Date: Thu, 17 Jul 2025 14:31:54 -0400 Subject: [PATCH 2/6] pr --- .github/workflows/manual_code_changes.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual_code_changes.yaml b/.github/workflows/manual_code_changes.yaml index 0817930e..c9ca5930 100644 --- a/.github/workflows/manual_code_changes.yaml +++ b/.github/workflows/manual_code_changes.yaml @@ -2,7 +2,9 @@ name: Manual Testing on: - workflow_dispatch: + pull_request: + branches: + - main env: HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} From 833320c89ebda702e047725047808b14d3015215 Mon Sep 17 00:00:00 2001 From: baogorek Date: Thu, 17 Jul 2025 15:12:56 -0400 Subject: [PATCH 3/6] updates --- .github/workflows/manual_code_changes.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual_code_changes.yaml b/.github/workflows/manual_code_changes.yaml index c9ca5930..83c0ebe5 100644 --- a/.github/workflows/manual_code_changes.yaml +++ b/.github/workflows/manual_code_changes.yaml @@ -13,7 +13,7 @@ env: jobs: Test: permissions: - contents: "read" + contents: "write" # Required to auth against gcp id-token: "write" runs-on: ubuntu-latest @@ -36,7 +36,7 @@ jobs: - name: Test documentation builds run: make documentation - name: Deploy documentation - uses: JamesIves/github-pages-deploy-action@releases/v3 + uses: JamesIves/github-pages-deploy-action@v4 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. From ca1efa1b5883d058857954f6d4d8615c1052b5ae Mon Sep 17 00:00:00 2001 From: baogorek Date: Thu, 17 Jul 2025 15:21:05 -0400 Subject: [PATCH 4/6] trying to get the right workflow to run --- .github/workflows/manual_code_changes.yaml | 2 +- .github/workflows/pr_code_changes.yaml | 178 ++++++++++----------- changelog_entry.yaml | 4 + 3 files changed, 94 insertions(+), 90 deletions(-) diff --git a/.github/workflows/manual_code_changes.yaml b/.github/workflows/manual_code_changes.yaml index 83c0ebe5..22edd161 100644 --- a/.github/workflows/manual_code_changes.yaml +++ b/.github/workflows/manual_code_changes.yaml @@ -41,5 +41,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. FOLDER: docs/_build/html # The folder the action should deploy. - CLEAN: true # Optionally delete the contents of the release branch before deploying.jk + CLEAN: true diff --git a/.github/workflows/pr_code_changes.yaml b/.github/workflows/pr_code_changes.yaml index 4e30d089..e1e01eb9 100644 --- a/.github/workflows/pr_code_changes.yaml +++ b/.github/workflows/pr_code_changes.yaml @@ -1,89 +1,89 @@ -# Workflow that runs on code changes to a pull request. - -name: PR code changes -on: - pull_request: - branches: - - main - - paths: - - policyengine_us_data/** - - tests/** - - .github/workflows/** - -jobs: - Lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check formatting - uses: "lgeiger/black-action@master" - with: - args: ". -l 79 --check" - - SmokeTestForMultipleVersions: - name: Smoke test (${{ matrix.os }}, Python ${{ matrix.python-version }}) - runs-on: ${{ matrix.os }} - needs: Lint - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ['3.11', '3.12'] - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install package ONLY (no dev deps) - run: python -m pip install . - - - name: Test basic import - run: python -c "import policyengine_us_data; print('Minimal import OK')" - - - name: Test specific core import - run: python -c "from policyengine_core.data import Dataset; print('Core import OK')" - - Test: - runs-on: ubuntu-latest - needs: Lint - env: - HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - name: Install package - run: uv pip install -e .[dev] --system - - - name: Download data inputs - run: make download - env: - HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - - - name: Build datasets - run: make data - env: - TEST_LITE: true - PYTHON_LOG_LEVEL: INFO - - name: Save calibration log - uses: actions/upload-artifact@v4 - with: - name: calibration_log.csv - path: calibration_log.csv - - name: Run tests - run: pytest - - - name: Test documentation builds - run: make documentation +## Workflow that runs on code changes to a pull request. +# +#name: PR code changes +#on: +# pull_request: +# branches: +# - main +# +# paths: +# - policyengine_us_data/** +# - tests/** +# - .github/workflows/** +# +#jobs: +# Lint: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Check formatting +# uses: "lgeiger/black-action@master" +# with: +# args: ". -l 79 --check" +# +# SmokeTestForMultipleVersions: +# name: Smoke test (${{ matrix.os }}, Python ${{ matrix.python-version }}) +# runs-on: ${{ matrix.os }} +# needs: Lint +# strategy: +# fail-fast: false +# matrix: +# os: [ubuntu-latest, windows-latest] +# python-version: ['3.11', '3.12'] +# steps: +# - name: Checkout repo +# uses: actions/checkout@v4 +# +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v5 +# with: +# python-version: ${{ matrix.python-version }} +# +# - name: Install package ONLY (no dev deps) +# run: python -m pip install . +# +# - name: Test basic import +# run: python -c "import policyengine_us_data; print('Minimal import OK')" +# +# - name: Test specific core import +# run: python -c "from policyengine_core.data import Dataset; print('Core import OK')" +# +# Test: +# runs-on: ubuntu-latest +# needs: Lint +# env: +# HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} +# steps: +# - name: Checkout repo +# uses: actions/checkout@v2 +# +# - name: Install uv +# uses: astral-sh/setup-uv@v5 +# +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: '3.11' +# - name: Install package +# run: uv pip install -e .[dev] --system +# +# - name: Download data inputs +# run: make download +# env: +# HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} +# +# - name: Build datasets +# run: make data +# env: +# TEST_LITE: true +# PYTHON_LOG_LEVEL: INFO +# - name: Save calibration log +# uses: actions/upload-artifact@v4 +# with: +# name: calibration_log.csv +# path: calibration_log.csv +# - name: Run tests +# run: pytest +# +# - name: Test documentation builds +# run: make documentation diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..c5c01c6e 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Github pages deploy From 9b24edf7b5801c0cfd92245f1a483752643f5ba3 Mon Sep 17 00:00:00 2001 From: baogorek Date: Thu, 17 Jul 2025 15:27:13 -0400 Subject: [PATCH 5/6] taking out the token --- .github/workflows/manual_code_changes.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual_code_changes.yaml b/.github/workflows/manual_code_changes.yaml index 22edd161..e527397c 100644 --- a/.github/workflows/manual_code_changes.yaml +++ b/.github/workflows/manual_code_changes.yaml @@ -38,8 +38,7 @@ jobs: - name: Deploy documentation uses: JamesIves/github-pages-deploy-action@v4 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs/_build/html # The folder the action should deploy. - CLEAN: true - + #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages # The branch the action should deploy to. + folder: docs/_build/html # The folder the action should deploy. + clean: true From 34d3ae1e07842dddf510756d422b9eee00dcdef1 Mon Sep 17 00:00:00 2001 From: baogorek Date: Thu, 17 Jul 2025 15:41:20 -0400 Subject: [PATCH 6/6] ready for review --- .github/workflows/code_changes.yaml | 16 +- .github/workflows/manual_code_changes.yaml | 44 ----- .github/workflows/pr_code_changes.yaml | 178 ++++++++++----------- 3 files changed, 96 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/manual_code_changes.yaml diff --git a/.github/workflows/code_changes.yaml b/.github/workflows/code_changes.yaml index b752e953..ffcafc6e 100644 --- a/.github/workflows/code_changes.yaml +++ b/.github/workflows/code_changes.yaml @@ -25,9 +25,8 @@ jobs: args: ". -l 79 --check" Test: permissions: - contents: "read" - # Required to auth against gcp - id-token: "write" + contents: "write" # Required for auth with Github Pages deploy + id-token: "write" # Required for auth with GCP runs-on: ubuntu-latest steps: - name: Checkout repo @@ -62,10 +61,9 @@ jobs: run: make upload - name: Test documentation builds run: make documentation - - name: Deploy documentation - uses: JamesIves/github-pages-deploy-action@releases/v3 + - name: Deploy Github Pages documentation + uses: JamesIves/github-pages-deploy-action@v4 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs/_build/html # The folder the action should deploy. - CLEAN: true # Optionally delete the contents of the release branch before deploying. + branch: gh-pages + folder: docs/_build/html + clean: true diff --git a/.github/workflows/manual_code_changes.yaml b/.github/workflows/manual_code_changes.yaml deleted file mode 100644 index e527397c..00000000 --- a/.github/workflows/manual_code_changes.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Workflow that runs on code changes after merge to main. - -name: Manual Testing -on: - pull_request: - branches: - - main - -env: - HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - POLICYENGINE_US_DATA_GITHUB_TOKEN: ${{ secrets.POLICYENGINE_US_DATA_GITHUB_TOKEN }} - -jobs: - Test: - permissions: - contents: "write" - # Required to auth against gcp - id-token: "write" - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - uses: "google-github-actions/auth@v2" - with: - workload_identity_provider: "projects/322898545428/locations/global/workloadIdentityPools/policyengine-research-id-pool/providers/prod-github-provider" - service_account: "policyengine-research@policyengine-research.iam.gserviceaccount.com" - - name: Install package - run: uv pip install -e .[dev] --system - - name: Test documentation builds - run: make documentation - - name: Deploy documentation - uses: JamesIves/github-pages-deploy-action@v4 - with: - #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages # The branch the action should deploy to. - folder: docs/_build/html # The folder the action should deploy. - clean: true diff --git a/.github/workflows/pr_code_changes.yaml b/.github/workflows/pr_code_changes.yaml index e1e01eb9..4e30d089 100644 --- a/.github/workflows/pr_code_changes.yaml +++ b/.github/workflows/pr_code_changes.yaml @@ -1,89 +1,89 @@ -## Workflow that runs on code changes to a pull request. -# -#name: PR code changes -#on: -# pull_request: -# branches: -# - main -# -# paths: -# - policyengine_us_data/** -# - tests/** -# - .github/workflows/** -# -#jobs: -# Lint: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - name: Check formatting -# uses: "lgeiger/black-action@master" -# with: -# args: ". -l 79 --check" -# -# SmokeTestForMultipleVersions: -# name: Smoke test (${{ matrix.os }}, Python ${{ matrix.python-version }}) -# runs-on: ${{ matrix.os }} -# needs: Lint -# strategy: -# fail-fast: false -# matrix: -# os: [ubuntu-latest, windows-latest] -# python-version: ['3.11', '3.12'] -# steps: -# - name: Checkout repo -# uses: actions/checkout@v4 -# -# - name: Set up Python ${{ matrix.python-version }} -# uses: actions/setup-python@v5 -# with: -# python-version: ${{ matrix.python-version }} -# -# - name: Install package ONLY (no dev deps) -# run: python -m pip install . -# -# - name: Test basic import -# run: python -c "import policyengine_us_data; print('Minimal import OK')" -# -# - name: Test specific core import -# run: python -c "from policyengine_core.data import Dataset; print('Core import OK')" -# -# Test: -# runs-on: ubuntu-latest -# needs: Lint -# env: -# HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} -# steps: -# - name: Checkout repo -# uses: actions/checkout@v2 -# -# - name: Install uv -# uses: astral-sh/setup-uv@v5 -# -# - name: Set up Python -# uses: actions/setup-python@v2 -# with: -# python-version: '3.11' -# - name: Install package -# run: uv pip install -e .[dev] --system -# -# - name: Download data inputs -# run: make download -# env: -# HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} -# -# - name: Build datasets -# run: make data -# env: -# TEST_LITE: true -# PYTHON_LOG_LEVEL: INFO -# - name: Save calibration log -# uses: actions/upload-artifact@v4 -# with: -# name: calibration_log.csv -# path: calibration_log.csv -# - name: Run tests -# run: pytest -# -# - name: Test documentation builds -# run: make documentation +# Workflow that runs on code changes to a pull request. + +name: PR code changes +on: + pull_request: + branches: + - main + + paths: + - policyengine_us_data/** + - tests/** + - .github/workflows/** + +jobs: + Lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check formatting + uses: "lgeiger/black-action@master" + with: + args: ". -l 79 --check" + + SmokeTestForMultipleVersions: + name: Smoke test (${{ matrix.os }}, Python ${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + needs: Lint + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.11', '3.12'] + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install package ONLY (no dev deps) + run: python -m pip install . + + - name: Test basic import + run: python -c "import policyengine_us_data; print('Minimal import OK')" + + - name: Test specific core import + run: python -c "from policyengine_core.data import Dataset; print('Core import OK')" + + Test: + runs-on: ubuntu-latest + needs: Lint + env: + HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + - name: Install package + run: uv pip install -e .[dev] --system + + - name: Download data inputs + run: make download + env: + HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} + + - name: Build datasets + run: make data + env: + TEST_LITE: true + PYTHON_LOG_LEVEL: INFO + - name: Save calibration log + uses: actions/upload-artifact@v4 + with: + name: calibration_log.csv + path: calibration_log.csv + - name: Run tests + run: pytest + + - name: Test documentation builds + run: make documentation