Skip to content

Fix/update us data #14560

Fix/update us data

Fix/update us data #14560

Workflow file for this run

name: Pull request
on:
pull_request:
branches: [master]
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
uses: "lgeiger/black-action@master"
with:
args: ". -l 79 --check"
check-version:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Build changelog
run: pip install yaml-changelog>=0.1.7 && make changelog
- name: Preview changelog update
run: ".github/get-changelog-diff.sh"
- name: Check version number has been properly updated
run: .github/is-version-number-acceptable.sh
Test:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install package
run: make install
- name: Run tests with detailed logging
run: |
python - <<EOF
import psutil
import subprocess
import time
import os
def get_process_info(pid):
try:
process = psutil.Process(pid)
return f"PID: {pid}, Name: {process.name()}, Status: {process.status()}"
except psutil.NoSuchProcess:
return f"PID: {pid} - Process not found"
def log_info(process):
memory_info = process.memory_info()
cpu_percent = process.cpu_percent(interval=1)
print(f"Time: {time.ctime()}")
print(f"Main process: {get_process_info(process.pid)}")
print(f"Memory usage: {memory_info.rss / 1024 / 1024:.2f} MB")
print(f"CPU usage: {cpu_percent:.2f}%")
print("Child processes:")
for child in process.children(recursive=True):
print(f" {get_process_info(child.pid)}")
print("Open files:")
for file in process.open_files():
print(f" {file.path}")
print("---")
process = subprocess.Popen(['python', '-m', 'pytest', 'policyengine_us/tests/policy/', '-v'],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
universal_newlines=True)
while process.poll() is None:
log_info(psutil.Process(process.pid))
# Print pytest output
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
if output:
print(output.strip())
time.sleep(10)
# Print final status
print(f"Process ended with return code: {process.returncode}")
EOF
env:
POVERTYTRACKER_RAW_URL: ${{ secrets.POVERTYTRACKER_RAW_URL }}
- uses: codecov/codecov-action@v4
- name: Build package
run: make
- name: Test documentation builds
if: matrix.os == 'ubuntu-latest'
run: make documentation