Start benchmarking server operations #3781
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: Sourcemeta One CI | |
| on: | |
| schedule: | |
| # Once per day, Monday to Friday | |
| - cron: '0 19 * * 1-5' | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: one-ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| # Building the Enterprise edition here is permitted by enterprise/LICENSE | |
| # clause (c), which allows building and running it for development and | |
| # testing in an automated continuous-integration environment without a | |
| # commercial license | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| edition: | |
| - name: community | |
| options: ENTERPRISE=OFF | |
| - name: enterprise | |
| options: ENTERPRISE=ON | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: make check ${{ matrix.edition.options }} | |
| # Cache the image ccache mount | |
| - uses: docker/setup-buildx-action@v3 | |
| id: buildx | |
| with: | |
| use: false | |
| - name: Cache the compiler cache | |
| uses: actions/cache@v4 | |
| id: ccache | |
| with: | |
| path: ccache-mount | |
| # The restore key carries the newest stored cache into every later | |
| # build, so a cache that goes bad keeps being handed forward and | |
| # saved again. Bumping the number below is how we throw them away | |
| key: ccache-v1-${{ matrix.edition.name }}-${{ github.sha }} | |
| restore-keys: ccache-v1-${{ matrix.edition.name }}- | |
| - uses: reproducible-containers/buildkit-cache-dance@5422eac04292c961a382e0f584ea0f03ad9da723 # v3.4.0 | |
| with: | |
| builder: ${{ steps.buildx.outputs.name }} | |
| cache-map: | | |
| { "ccache-mount": "/ccache" } | |
| - run: > | |
| make docker-build | |
| PRESET=Release | |
| PARALLEL=$(nproc) | |
| DOCKERFILE_TEST_REPEAT=2 | |
| DOCKER="docker buildx" | |
| DOCKER_BUILD_FLAGS="--load --builder ${{ steps.buildx.outputs.name }}" | |
| ${{ matrix.edition.options }} | |
| - name: SBOM (Enterprise) | |
| run: | | |
| node ./enterprise/scripts/sbom.js one /tmp/sbom.spdx.json | |
| cat /tmp/sbom.spdx.json | |
| npx --yes @sourcemeta/jsonschema validate \ | |
| vendor/spdx/schemas/spdx-schema.json /tmp/sbom.spdx.json --verbose | |
| if: matrix.edition.name == 'enterprise' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| - name: E2E (empty) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: test/e2e/empty | |
| edition: ${{ matrix.edition.name }} | |
| - name: E2E (headless) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: test/e2e/headless | |
| edition: ${{ matrix.edition.name }} | |
| - name: E2E (html) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: test/e2e/html | |
| edition: ${{ matrix.edition.name }} | |
| - name: E2E (meta) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: test/e2e/meta | |
| edition: ${{ matrix.edition.name }} | |
| - name: E2E (no-api) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: test/e2e/no-api | |
| edition: ${{ matrix.edition.name }} | |
| - name: E2E (chaos) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: test/e2e/chaos | |
| edition: ${{ matrix.edition.name }} | |
| - name: E2E (enterprise/empty) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/empty | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| - name: E2E (enterprise/html) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/html | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| - name: E2E (enterprise/public) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/public | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| - name: E2E (enterprise/auth-keys) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/auth-keys | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| - name: E2E (enterprise/auth) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/auth | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| - name: E2E (enterprise/auth-closed) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/auth-closed | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| - name: E2E (enterprise/auth-sso) | |
| uses: ./.github/actions/e2e | |
| with: | |
| path: enterprise/e2e/auth-sso | |
| edition: ${{ matrix.edition.name }} | |
| if: matrix.edition.name == 'enterprise' | |
| # The suites measured themselves as they ran, leaving what they measured | |
| # under `build/benchmark`, so what is left is to take the indexer's own | |
| # measurements and say all of it at once. This action keeps a checkout of | |
| # the branch it records into, so it is called exactly once per job rather | |
| # than once per kind of measurement | |
| - name: Benchmark | |
| run: | | |
| make docker-benchmark PRESET=Release ${{ matrix.edition.options }} | |
| docker run --rm --volume "$PWD/build/benchmark:/results:ro" \ | |
| one-benchmark > build/benchmark.json | |
| cat build/benchmark.json | |
| - uses: benchmark-action/github-action-benchmark@v1 | |
| if: github.event.pull_request.head.repo.fork == false | |
| with: | |
| # TODO: Rename to `Benchmark (<edition>)`, as this now carries | |
| # server measurements too. The name keys the series stored on | |
| # `gh-pages`, and only pushes to `main` write there, so renaming | |
| # starts an empty series and suppresses the comparison comment until | |
| # the first push after the rename lands | |
| name: Benchmark Index (${{ matrix.edition.name }}) | |
| tool: customSmallerIsBetter | |
| output-file-path: build/benchmark.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: ${{ github.event_name != 'pull_request' }} | |
| benchmark-data-dir-path: benchmark/${{ matrix.edition.name }}/index | |
| alert-threshold: '5%' | |
| comment-always: true | |
| fail-on-alert: false | |
| website: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - run: pip install mkdocs-material | |
| - run: mkdocs build --config-file mkdocs.yml --strict --site-dir ./build/website |