⬆️ Use fetch instead of axios (second attempt)
#3739
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 💚 CI Tests - Federation Admin | |
| on: | |
| push: | |
| permissions: | |
| contents: read | |
| jobs: | |
| global: | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: ./admin | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: yarn | |
| cache-dependency-path: ./admin/yarn.lock | |
| node-version-file: ./admin/package.json | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run lint | |
| run: yarn lint | |
| - name: Run tests | |
| run: yarn test | |
| - name: Run coverage | |
| run: | | |
| yarn test --coverage | |
| ./scripts/coverage.sh | |
| e2e-exploitation: | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: ./admin | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up dockerx | |
| uses: docker/setup-buildx-action@v4 | |
| # Workaround for https://github.com/docker/compose/issues/12892 | |
| - name: Upgrade Docker Compose | |
| uses: docker/setup-compose-action@v2 | |
| with: | |
| version: latest | |
| - name: Set up Node.js for federation-admin | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: yarn | |
| cache-dependency-path: ./admin/yarn.lock | |
| node-version-file: ./admin/package.json | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Set PC_ROOT environment variable | |
| run: | | |
| PC_ROOT=$(dirname "$(pwd)") | |
| echo "PC_ROOT=$PC_ROOT" >> $GITHUB_ENV | |
| working-directory: ./ | |
| - name: Set FEDERATION_DIR environment variable | |
| run: echo "FEDERATION_DIR=$(pwd)" >> $GITHUB_ENV | |
| working-directory: ./ | |
| - name: Set ADMIN_ROOT environment variable | |
| run: echo "ADMIN_ROOT=$(pwd)" >> $GITHUB_ENV | |
| - name: Start docker stack | |
| working-directory: ./docker | |
| run: | | |
| ./docker-stack prune-ci | |
| ./docker-stack up admin | |
| ./docker-stack wait "admin" "https://exploitation-fca-low.docker.dev-franceconnect.fr/login" "240" | |
| - name: Start tests | |
| run: yarn test:e2e:exploitation -c video=false | |
| - name: Post failing tests | |
| if: failure() | |
| run: | | |
| mkdir -p cypress/logs | |
| docker cp pc-exploitation-1:/tmp/.pm2/logs cypress/logs || true | |
| docker cp pc-rp-all:/var/log/nginx cypress/logs || true | |
| - name: Publish artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: cypress-outputs | |
| path: | | |
| admin/cypress/screenshots | |
| admin/cypress/videos | |
| admin/cypress/logs |