From 496530cbf5094b7856d2bbc355fb350bb8fcd799 Mon Sep 17 00:00:00 2001 From: jbpratt Date: Fri, 10 Oct 2025 08:50:44 -0500 Subject: [PATCH] ci: separate web CI jobs into dedicated workflow (PROJQUAY-9536) (#4343) this creates web-ci.yaml with cypress and frontend-plugin jobs that only run when web/, docker-compose.yaml, Dockerfile, or local-dev/ paths change, and excludes web/ from the main CI workflow to prevent redundant runs Signed-off-by: Brady Pratt --- .github/workflows/CI.yaml | 108 ++--------------------------- .github/workflows/web-ci.yaml | 124 ++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 104 deletions(-) create mode 100644 .github/workflows/web-ci.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 22fb3ec65..ad838f8a9 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -6,9 +6,13 @@ on: branches: - "!dependabot/*" - "*" + paths-ignore: + - "web/**" pull_request: branches: - "*" + paths-ignore: + - "web/**" jobs: build: name: Format @@ -187,110 +191,6 @@ jobs: - name: tox run: | tox -e py312-registry - - cypress: - name: Cypress Tests - runs-on: ubuntu-22.04 - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Docker Build - env: - DOCKER_BUILDKIT: 1 - run: docker build -t localhost/quay-local:latest . - - - name: Start Quay - run: | - docker compose up -d redis quay-db - docker exec -t quay-db bash -c 'while ! pg_isready; do echo "waiting for postgres"; sleep 2; done' - DOCKER_USER="1001:0" docker compose up -d --no-build quay - - - name: Checkout - uses: actions/checkout@v3 - - - name: Seed Database - run: cd web && npm run quay:seed - - - name: Set up Python 3.12 - uses: actions/setup-python@v4 - with: - python-version: 3.12 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest requests - - - name: Integration Test - run: | - docker restart quay-quay - sleep 30 - make integration-test - - - name: Apply extra config options - run: | - cat web/cypress/test/extra-config.yaml >> local-dev/stack/config.yaml - docker restart quay-quay - sleep 30 - - - name: Cypress run - uses: cypress-io/github-action@v5 - with: - browser: chrome - build: npm run build - start: npm run start:integration - wait-on: 'http://localhost:9000' - wait-on-timeout: 120 - working-directory: web - env: - REACT_QUAY_APP_API_URL: http://localhost:8080 - - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-screenshots - path: web/cypress/screenshots - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: cypress-videos - path: web/cypress/videos - - - name: Create report - run: | - mkdir -p logs/ - docker ps -a >logs/container-status.txt 2>&1 || true - docker logs quay-quay >logs/quay.log 2>&1 || true - docker logs quay-db >logs/quay-db.log 2>&1 || true - docker logs quay-redis >logs/redis.log 2>&1 || true - if: always() - - - name: Upload Quay logs - uses: actions/upload-artifact@v4 - with: - name: logs - path: logs/ - if: always() - - frontend-plugin: - name: Build Frontend Plugin - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: cd web && npm install - - - name: Build plugin - run: cd web && npm run build-plugin - mysql: name: E2E MySQL Test runs-on: ubuntu-22.04 diff --git a/.github/workflows/web-ci.yaml b/.github/workflows/web-ci.yaml new file mode 100644 index 000000000..0abc26f9e --- /dev/null +++ b/.github/workflows/web-ci.yaml @@ -0,0 +1,124 @@ +name: Web CI +on: + push: + branches: + - "!dependabot/*" + - "*" + paths: + - "web/**" + - "docker-compose.yaml" + - "Dockerfile" + - "local-dev/**" + - ".github/workflows/web-ci.yaml" + pull_request: + branches: + - "*" + paths: + - "web/**" + - "docker-compose.yaml" + - "Dockerfile" + - "local-dev/**" + - ".github/workflows/web-ci.yaml" +jobs: + cypress: + name: Cypress Tests + runs-on: ubuntu-22.04 + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Docker Build + env: + DOCKER_BUILDKIT: 1 + run: docker build -t localhost/quay-local:latest . + + - name: Start Quay + run: | + docker compose up -d redis quay-db + docker exec -t quay-db bash -c 'while ! pg_isready; do echo "waiting for postgres"; sleep 2; done' + DOCKER_USER="1001:0" docker compose up -d --no-build quay + + - name: Checkout + uses: actions/checkout@v3 + + - name: Seed Database + run: cd web && npm run quay:seed + + - name: Set up Python 3.12 + uses: actions/setup-python@v4 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest requests + + - name: Integration Test + run: | + docker restart quay-quay + sleep 30 + make integration-test + + - name: Apply extra config options + run: | + cat web/cypress/test/extra-config.yaml >> local-dev/stack/config.yaml + docker restart quay-quay + sleep 30 + + - name: Cypress run + uses: cypress-io/github-action@v5 + with: + browser: chrome + build: npm run build + start: npm run start:integration + wait-on: 'http://localhost:9000' + wait-on-timeout: 120 + working-directory: web + env: + REACT_QUAY_APP_API_URL: http://localhost:8080 + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: cypress-screenshots + path: web/cypress/screenshots + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: cypress-videos + path: web/cypress/videos + + - name: Create report + run: | + mkdir -p logs/ + docker ps -a >logs/container-status.txt 2>&1 || true + docker logs quay-quay >logs/quay.log 2>&1 || true + docker logs quay-db >logs/quay-db.log 2>&1 || true + docker logs quay-redis >logs/redis.log 2>&1 || true + if: always() + + - name: Upload Quay logs + uses: actions/upload-artifact@v4 + with: + name: logs + path: logs/ + if: always() + + frontend-plugin: + name: Build Frontend Plugin + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install dependencies + run: cd web && npm install + + - name: Build plugin + run: cd web && npm run build-plugin