diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5acb722e..805d9c39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,35 +37,36 @@ jobs: run: | flake8 . || true - test-and-coverage: - name: Tests & Coverage + test-backend: + name: Backend Tests (Go) runs-on: ubuntu-latest needs: [lint] steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - - name: Set up Python - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 with: - python-version: '3.12' - - name: Cache pip - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + go-version: '1.22' + - name: Run Go tests + working-directory: backend + run: | + go test -v ./... + + test-frontend: + name: Frontend Tests (React) + runs-on: ubuntu-latest + needs: [lint] + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + node-version: '20' + cache: 'npm' + cache-dependency-path: frontend/package-lock.json - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt || true - pip install -r requirements.dev.txt - - name: Run tests with coverage - run: | - # run pytest under coverage and fail if tests fail - coverage run -m pytest -q - coverage report -m --fail-under=75 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 - with: - fail_ci_if_error: false - # Note: Add CODECOV_TOKEN to repo secrets if upload fails or for private repos + working-directory: frontend + run: npm ci + - name: Run frontend tests + working-directory: frontend + run: npm test