Skip to content

fix(refresh-data): fixes cron job #301

fix(refresh-data): fixes cron job

fix(refresh-data): fixes cron job #301

Workflow file for this run

name: Lint and test
on: pull_request
env:
PYTHON_VERSION: '3.11'
POETRY_VERSION: '2.0.1'
SERVICE_ACCOUNT: 'github-actions-service-account@cal-itp-data-infra.iam.gserviceaccount.com'
WORKLOAD_IDENTITY_PROVIDER: 'projects/1005246706141/locations/global/workloadIdentityPools/github-actions/providers/reports'
PROJECT_ID: 'cal-itp-data-infra'
REPORTS_DATA_BUCKET: 'calitp-reports-data'
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
test:
name: test
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticate Google Service Account
uses: google-github-actions/auth@v2
with:
create_credentials_file: true
project_id: ${{ env.PROJECT_ID }}
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ env.SERVICE_ACCOUNT }}
- name: Setup GCloud utilities
uses: google-github-actions/setup-gcloud@v2
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache Poetry
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-poetry-${{ env.POETRY_VERSION }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Cache Python packages
uses: actions/cache@v3
with:
path: ~/.local
key: python-cache-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-lock-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: website/package.json
cache: npm
cache-dependency-path: website/package-lock.json
- name: Install python dependencies
working-directory: website
run: poetry install
- name: Install node dependencies
working-directory: website
run: npm install
- name: Run data tests
working-directory: tests
run: poetry run python test_report_data.py
- name: Prepare website build
run: cp -r tests/outputs/2024 reports/outputs/. && cp tests/fixtures/* reports/outputs/.
- name: Run website build
working-directory: website
run: poetry run npm run build
- name: Assert website name
working-directory: website
run: cat build/index.html | grep "Monthly GTFS Quality Reports"