Skip to content

prettier

prettier #276

Workflow file for this run

name: CI
on:
push:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check out building-data-utilities repository
uses: actions/checkout@v5
with:
repository: SEED-platform/building-data-utilities
path: building-data-utilities
- name: Move building-data-utilities to expected location
run: |
mkdir -p ../
mv building-data-utilities ../building-data-utilities
- name: Set up Python 3.12
uses: actions/[email protected]
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/[email protected]
- name: Install Python dependencies
working-directory: flask_app
run: |
python -m pip install --upgrade pip
poetry install
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Install Angular dependencies
working-directory: angular-app
run: |
npm install
cp src/environments/environment.ts.template src/environments/environment.ts
- name: Run pre-commit
run: poetry run pre-commit run --all-files --show-diff-on-failure
python-tests:
needs: lint
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check out building-data-utilities repository
uses: actions/checkout@v5
with:
repository: SEED-platform/building-data-utilities
path: building-data-utilities
- name: Move building-data-utilities to expected location
run: |
mkdir -p ../
mv building-data-utilities ../building-data-utilities
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/[email protected]
- name: Install Python dependencies
working-directory: flask_app
run: |
python -m pip install --upgrade pip
poetry install
- name: Run Python Tests
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
AMAZON_API_KEY: ${{ secrets.AMAZON_API_KEY }}
AMAZON_BASE_URL: ${{ secrets.AMAZON_BASE_URL }}
AMAZON_APP_ID: ${{ secrets.AMAZON_APP_ID }}
working-directory: flask_app
run: poetry run pytest --cov=flask_app --cov-report=html --cov-report=xml --cov-report=term --disable-warnings
- name: Upload Python Test Coverage
if: matrix.python-version == '3.12' # Only upload once per build
uses: actions/upload-artifact@v4
with:
name: python-coverage
path: flask_app/htmlcov/
retention-days: 7
angular-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Install node dependencies and Google Chrome
working-directory: angular-app
run: |
npm install
# Need chrome for Angular tests
sudo apt-get update
sudo apt-get install -y google-chrome-stable
# copy over the environment.ts, otherwise tests will fail.
cp src/environments/environment.ts.template src/environments/environment.ts
- name: Build Angular Application
working-directory: angular-app
run: |
# Verify the app builds successfully before running tests
npm run build
- name: Run Angular Tests
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
AMAZON_API_KEY: ${{ secrets.AMAZON_API_KEY }}
AMAZON_BASE_URL: ${{ secrets.AMAZON_BASE_URL }}
AMAZON_APP_ID: ${{ secrets.AMAZON_APP_ID }}
working-directory: angular-app
run: |
# This executes all *.spec.ts files in the project
npm test
- name: Upload Angular Test Coverage
uses: actions/upload-artifact@v4
with:
name: angular-coverage
path: angular-app/coverage/
retention-days: 7