feat(web-scraping): add support for tracker execution log #218
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: Secutils | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '*.md' | |
| - '.husky/**' | |
| - 'LICENSE' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| ci-api: | |
| name: Build API (Linux) | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: postgres://postgres@localhost:5432/secutils | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| # Always install nightly toolchain for `Rustfmt`. | |
| - name: Install toolchains | |
| run: | | |
| rustup toolchain install stable nightly | |
| rustup override set stable | |
| rustup component add clippy | |
| rustup component add --toolchain nightly rustfmt | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check format | |
| run: cargo +nightly fmt --all -- --check | |
| - name: Check database schema | |
| run: | | |
| curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| cargo binstall --no-confirm sqlx-cli | |
| cargo sqlx database create | |
| cargo sqlx migrate run | |
| cargo sqlx prepare --check | |
| - name: Test (default features) | |
| run: cargo test | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| ci-webui: | |
| name: Build Web UI (Linux) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm --prefix components/secutils-webui ci | |
| - name: Test | |
| run: npm --prefix components/secutils-webui run test | |
| - name: Build | |
| run: npm --prefix components/secutils-webui run build | |
| ci-docs: | |
| name: Build Docs (Linux) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm --prefix components/secutils-docs ci | |
| - name: Build | |
| run: npm --prefix components/secutils-docs run build | |
| ci-e2e: | |
| name: E2E Tests (Linux) | |
| runs-on: ubuntu-latest | |
| needs: [ci-api, ci-webui] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| cache-dependency-path: e2e/package-lock.json | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build all Docker images | |
| uses: docker/bake-action@v6 | |
| with: | |
| files: | | |
| dev/docker/docker-compose.yml | |
| dev/docker/docker-compose.e2e.yml | |
| dev/docker/docker-compose.ci-cache.yml | |
| load: true | |
| set: | | |
| retrack.cache-from=type=gha,scope=retrack | |
| retrack.cache-to=type=gha,mode=max,scope=retrack | |
| retrack_web_scraper.cache-from=type=gha,scope=retrack-web-scraper | |
| retrack_web_scraper.cache-to=type=gha,mode=max,scope=retrack-web-scraper | |
| secutils_api.cache-from=type=gha,scope=secutils-api | |
| secutils_api.cache-to=type=gha,mode=max,scope=secutils-api | |
| secutils_webui.cache-from=type=gha,scope=secutils-webui | |
| secutils_webui.cache-to=type=gha,mode=max,scope=secutils-webui | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ hashFiles('e2e/package-lock.json') }} | |
| - name: Install Playwright | |
| working-directory: e2e | |
| run: | | |
| npm ci | |
| npx playwright install --with-deps chromium | |
| - name: Start services | |
| run: > | |
| docker compose | |
| -f dev/docker/docker-compose.yml | |
| -f dev/docker/docker-compose.e2e.yml | |
| -f dev/docker/docker-compose.ci-cache.yml | |
| up -d --wait | |
| - name: Verify services are ready | |
| run: | | |
| curl -sf --retry 12 --retry-delay 5 --retry-all-errors http://localhost:7070/api/status | |
| curl -sf --retry 6 --retry-delay 5 --retry-all-errors http://localhost:7171/ | |
| - name: Run Playwright tests | |
| working-directory: e2e | |
| run: npx playwright test | |
| env: | |
| BASE_URL: http://localhost:7171 | |
| - name: Generate doc screenshots | |
| if: success() | |
| working-directory: e2e | |
| run: npx playwright test --config playwright.docs.config.ts | |
| env: | |
| BASE_URL: http://localhost:7171 | |
| - name: Upload doc screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: doc-screenshots | |
| path: components/secutils-docs/static/img/docs/guides/ | |
| retention-days: 14 | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: e2e/playwright-report/ | |
| retention-days: 14 | |
| - name: Collect Docker logs on failure | |
| if: failure() | |
| run: > | |
| docker compose | |
| -f dev/docker/docker-compose.yml | |
| -f dev/docker/docker-compose.e2e.yml | |
| logs > docker-logs.txt 2>&1 | |
| - name: Upload Docker logs | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: docker-logs | |
| path: docker-logs.txt | |
| retention-days: 7 | |
| - name: Stop services | |
| if: always() | |
| run: > | |
| docker compose | |
| -f dev/docker/docker-compose.yml | |
| -f dev/docker/docker-compose.e2e.yml | |
| down --volumes |