hackforla / HomeUniteUs

We're working with community non-profits who have a Host Home or empty bedrooms initiative to develop a workflow management tool to make the process scalable (across all providers), reduce institutional bias, and effectively capture data.
https://homeunite.us/
GNU General Public License v2.0
39 stars 21 forks source link

Revert to the original run-tests workflow #750

Closed erikguntner closed 3 months ago

erikguntner commented 3 months ago

Overview

We merged in a GitHub workflow that isn't currently in a functional state so we should revert to the old one while holding onto the new one.

Action Items

Resources/Instructions

The original workflow:

name: Run API and App Tests
on:
  pull_request:
    branches: [main]
  # This is also a reusable workflow that can be called from other workflows
  workflow_call:
  workflow_dispatch:
jobs:
  test-api:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: ./api
    steps:
      - uses: actions/checkout@main
        with:
          fetch-depth: 500
          fetch-tags: true
      - name: Set up Python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: "3.10"
          cache: "pip"
      - name: Upgrade pip
        run: python -m pip install --upgrade pip
      - name: Install API dev Dependencies
        run: |
          pip install -r requirements-dev.txt
      - name: Run development tests with mocking enabled, using tox
        run: |
          # Use tox because it is configured to test against the same package type being deployed
          tox
      - name: Run release tests with mocking disabled, using tox
        env:
          COGNITO_REGION: ${{ secrets.COGNITO_REGION }}
          COGNITO_ACCESS_ID: ${{ secrets.COGNITO_ACCESS_ID }}
          COGNITO_ACCESS_KEY: ${{ secrets.COGNITO_ACCESS_KEY }}
        run: |
          echo "COGNITO_REGION set"
          tox -e releasetest
  test-app:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: ./app
    steps:
      - uses: actions/checkout@v4
      - name: Use Node.js 20
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: "npm"
          cache-dependency-path: app/package-lock.json
      - name: Run npm CI
        run: npm ci
      - name: Test app
        run: npm run test -- --no-color --run
      - name: Run E2E tests
        uses: cypress-io/github-action@v5
        with:
          install: false
          start: npm run dev
          working-directory: ./app
          wait-on: "http://[::1]:4040/"
lola3736 commented 4 days ago

@johnwroge please review the milestone label "Migrate from Flask to FastAPI" for accuracy.