diff --git a/.github/workflows/frontend.yml b/.github/workflows/ci.yml similarity index 96% rename from .github/workflows/frontend.yml rename to .github/workflows/ci.yml index 041a2c0..b901eba 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/ci.yml @@ -1,16 +1,12 @@ -name: Frontend CI - +name: CI on: push: pull_request: - concurrency: group: frontend-ci-${{ github.ref }} cancel-in-progress: true - permissions: contents: read - jobs: test: name: Jest on Node ${{ matrix.node }} @@ -18,40 +14,33 @@ jobs: strategy: fail-fast: false matrix: - node: [18, 20] # LTS + current used in repo - + node: [18, 20, 22] env: CI: "1" EXPO_TUNNEL: "false" EXPO_DEVTOOLS_LISTEN_ADDRESS: 0.0.0.0 EXPO_PUBLIC_API_BASE: http://localhost:8000 - steps: - name: Checkout uses: actions/checkout@v4 - - name: Use Node ${{ matrix.node }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: npm cache-dependency-path: frontend/app/package-lock.json - - name: Install deps working-directory: frontend/app run: npm ci - - name: Type check (skip if no TS) if: hashFiles('frontend/app/tsconfig.json') != '' working-directory: frontend/app run: | npx --yes typescript@latest -v >/dev/null 2>&1 || true npx tsc --noEmit || (echo "::warning::Type check failed"; exit 1) - - name: Run Jest with coverage (CI mode) working-directory: frontend/app run: npm test -- --ci --runInBand --coverage --verbose - - name: Upload coverage if: always() uses: actions/upload-artifact@v4 @@ -59,7 +48,6 @@ jobs: name: coverage-node${{ matrix.node }} path: frontend/app/coverage if-no-files-found: warn - web-export-smoke: name: Expo web export (smoke) needs: test @@ -69,22 +57,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Use Node 20 uses: actions/setup-node@v4 with: node-version: 20 cache: npm cache-dependency-path: frontend/app/package-lock.json - - name: Install deps working-directory: frontend/app run: npm ci - - name: Build (expo export -p web) working-directory: frontend/app run: npx expo export -p web - - name: Upload dist (preview artifact) if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 98be759..0ccb427 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,4 +1,4 @@ -name: Deploy Expo Web to GitHub Pages +name: GitHub Pages on: push: branches: [ "main" ] diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1c199a3..75ef9b8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -name: Frontend Tests via Docker +name: docker on: workflow_dispatch: pull_request: diff --git a/README.md b/README.md index 40e8434..0796ca0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # [Python Front](https://github.com/europanite/python_front "Python Front") +[![CI](https://github.com/europanite/python_front/actions/workflows/ci.yml/badge.svg)](https://github.com/europanite/python_front/actions/workflows/ci.yml) +[![Frontend Tests via Docker](https://github.com/europanite/python_front/actions/workflows/docker.yml/badge.svg)](https://github.com/europanite/python_front/actions/workflows/docker.yml) +[![Deploy Expo Web to GitHub Pages](https://github.com/europanite/python_front/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/europanite/python_front/actions/workflows/deploy-pages.yml) + A browser based Python playground. !["web_ui"](./assets/images/web_ui.png)