Repository navigation
Goal join performance #20070
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: Elixir CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master, stable] | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CACHE_VERSION: v19 | |
| PERSISTENT_CACHE_DIR: cached | |
| npm_config_audit: false | |
| npm_config_fund: false | |
| jobs: | |
| build: | |
| name: "Build and test (${{ matrix.mix_env }}, ${{ matrix.postgres_image }}, ${{ matrix.mix_test_partition }})" | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| strategy: | |
| matrix: | |
| mix_env: ["test", "ce_test"] | |
| postgres_image: ["postgres:18"] | |
| mix_test_partition: [1, 2, 3, 4, 5, 6] | |
| env: | |
| MIX_ENV: ${{ matrix.mix_env }} | |
| services: | |
| postgres: | |
| image: ${{ matrix.postgres_image }} | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| clickhouse: | |
| image: clickhouse/clickhouse-server:25.11.5.8-alpine | |
| ports: | |
| - 8123:8123 | |
| env: | |
| CLICKHOUSE_SKIP_USER_SETUP: 1 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| filter: blob:none | |
| - uses: marocchino/tool-versions-action@4219f2e6bfdb4cce482b78f71ad9663e64f4d247 # v2.0.0 | |
| id: versions | |
| - uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1 | |
| with: | |
| elixir-version: ${{ steps.versions.outputs.elixir }} | |
| otp-version: ${{ steps.versions.outputs.erlang }} | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| tracker/node_modules | |
| priv/tracker/js | |
| priv/tracker/installation_support | |
| ${{ env.PERSISTENT_CACHE_DIR }} | |
| key: ${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-${{ github.head_ref || github.ref }}- | |
| ${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-refs/heads/master- | |
| - name: Check for changes in tracker/** | |
| uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 | |
| id: changes | |
| with: | |
| filters: | | |
| tracker: | |
| - 'tracker/**' | |
| - name: Check if tracker and verifier are built already | |
| run: | | |
| if [ -f priv/tracker/js/plausible-web.js ] && [ -f priv/tracker/installation_support/verifier.js ]; then | |
| echo "HAS_BUILT_TRACKER=true" >> $GITHUB_ENV | |
| else | |
| echo "HAS_BUILT_TRACKER=false" >> $GITHUB_ENV | |
| fi | |
| - run: npm install --prefix ./tracker | |
| if: steps.changes.outputs.tracker == 'true' || env.HAS_BUILT_TRACKER == 'false' | |
| - run: npm run deploy --prefix ./tracker | |
| if: steps.changes.outputs.tracker == 'true' || env.HAS_BUILT_TRACKER == 'false' | |
| - run: mix deps.get --only $MIX_ENV | |
| - run: mix compile --warnings-as-errors --all-warnings | |
| - name: Wait for Postgres and ClickHouse | |
| run: | | |
| timeout 120 bash -c 'until docker exec ${{ job.services.postgres.id }} pg_isready -h 127.0.0.1 -U postgres -q; do sleep 0.5; done' | |
| timeout 120 bash -c 'until curl -sf http://127.0.0.1:8123/ping > /dev/null; do sleep 0.5; done' | |
| - run: mix do ecto.create, ecto.migrate | |
| - run: mix run -e "Tzdata.ReleaseUpdater.poll_for_update" | |
| - run: make minio | |
| if: env.MIX_ENV == 'test' | |
| - run: mix test --include slow --include minio --include migrations --max-failures 1 --warnings-as-errors --partitions 6 | |
| if: env.MIX_ENV == 'test' | |
| env: | |
| MINIO_HOST_FOR_CLICKHOUSE: "172.17.0.1" | |
| MIX_TEST_PARTITION: ${{ matrix.mix_test_partition }} | |
| - run: mix test --include slow --include migrations --max-failures 1 --warnings-as-errors --partitions 6 | |
| if: env.MIX_ENV == 'ce_test' | |
| env: | |
| MIX_TEST_PARTITION: ${{ matrix.mix_test_partition }} | |
| e2e: | |
| name: End-to-end tests | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| timeout-minutes: 15 | |
| env: | |
| MIX_ENV: e2e_test | |
| BASE_URL: "http://localhost:8111" | |
| services: | |
| postgres: | |
| image: "postgres:18" | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| clickhouse: | |
| image: clickhouse/clickhouse-server:25.11.5.8-alpine | |
| ports: | |
| - 8123:8123 | |
| env: | |
| CLICKHOUSE_SKIP_USER_SETUP: 1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shardIndex: [1, 2] | |
| shardTotal: [2] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| filter: blob:none | |
| - uses: marocchino/tool-versions-action@4219f2e6bfdb4cce482b78f71ad9663e64f4d247 # v2.0.0 | |
| id: versions | |
| - uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1 | |
| with: | |
| elixir-version: ${{ steps.versions.outputs.elixir }} | |
| otp-version: ${{ steps.versions.outputs.erlang }} | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| assets/node_modules | |
| tracker/node_modules | |
| priv/tracker/js | |
| priv/tracker/installation_support | |
| ${{ env.PERSISTENT_CACHE_DIR }} | |
| key: e2e-${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| e2e-${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-${{ github.head_ref || github.ref }}- | |
| e2e-${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-refs/heads/master- | |
| - name: Cache E2E dependencies and Playwright browsers | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| id: playwright-cache | |
| with: | |
| path: | | |
| e2e/node_modules | |
| ~/.cache/ms-playwright | |
| ~/.cache/ms-playwright-github | |
| key: playwright-${{ runner.os }}-${{ hashFiles('e2e/package-lock.json') }} | |
| restore-keys: | | |
| playwright-${{ runner.os }}- | |
| - name: Check for changes in tracker/** | |
| uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 | |
| id: changes | |
| with: | |
| filters: | | |
| tracker: | |
| - 'tracker/**' | |
| - name: Check if tracker and verifier are built already | |
| run: | | |
| if [ -f priv/tracker/js/plausible-web.js ] && [ -f priv/tracker/installation_support/verifier.js ]; then | |
| echo "HAS_BUILT_TRACKER=true" >> $GITHUB_ENV | |
| else | |
| echo "HAS_BUILT_TRACKER=false" >> $GITHUB_ENV | |
| fi | |
| - run: npm install --prefix ./tracker | |
| if: steps.changes.outputs.tracker == 'true' || env.HAS_BUILT_TRACKER == 'false' | |
| - run: npm run deploy --prefix ./tracker | |
| if: steps.changes.outputs.tracker == 'true' || env.HAS_BUILT_TRACKER == 'false' | |
| - run: mix deps.get --only $MIX_ENV | |
| - run: mix compile --warnings-as-errors --all-warnings | |
| - run: npm install --prefix ./assets | |
| - run: mix assets.deploy | |
| - name: Wait for Postgres and ClickHouse | |
| run: | | |
| timeout 120 bash -c 'until docker exec ${{ job.services.postgres.id }} pg_isready -h 127.0.0.1 -U postgres -q; do sleep 0.5; done' | |
| timeout 120 bash -c 'until curl -sf http://127.0.0.1:8123/ping > /dev/null; do sleep 0.5; done' | |
| - run: mix do ecto.create, ecto.migrate | |
| - run: mix download_country_database | |
| - run: mix run -e "Tzdata.ReleaseUpdater.poll_for_update" | |
| - name: Install E2E dependencies | |
| run: npm --prefix ./e2e ci | |
| - name: Check format | |
| run: npm --prefix ./e2e run check-format | |
| - name: Check types | |
| run: npm --prefix ./e2e run typecheck | |
| - name: Install E2E Playwright Browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| working-directory: ./e2e | |
| run: npx playwright install --with-deps chromium | |
| - name: Run E2E Playwright tests | |
| run: npm --prefix ./e2e test -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob | |
| - name: Upload E2E blob report to GitHub Actions Artifacts | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: e2e-blob-report-${{ matrix.shardIndex }} | |
| path: e2e/blob-report | |
| retention-days: 1 | |
| merge-sharded-e2e-test-report: | |
| if: ${{ !cancelled() }} | |
| needs: [e2e] | |
| timeout-minutes: 15 | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24.17.0 | |
| cache: 'npm' | |
| cache-dependency-path: e2e/package-lock.json | |
| - name: Install dependencies | |
| run: npm --prefix ./e2e ci | |
| - name: Download blob reports from GitHub Actions Artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: all-e2e-blob-reports | |
| pattern: e2e-blob-report-* | |
| merge-multiple: true | |
| - name: Merge into list report | |
| working-directory: ./e2e | |
| run: npx playwright merge-reports --reporter list ../all-e2e-blob-reports | |
| static: | |
| name: Static checks (format, credo, dialyzer) | |
| env: | |
| MIX_ENV: test | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| filter: blob:none | |
| - uses: marocchino/tool-versions-action@4219f2e6bfdb4cce482b78f71ad9663e64f4d247 # v2.0.0 | |
| id: versions | |
| - uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1 | |
| with: | |
| elixir-version: ${{ steps.versions.outputs.elixir }} | |
| otp-version: ${{ steps.versions.outputs.erlang }} | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| priv/plts | |
| key: static-${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| static-${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-${{ github.head_ref || github.ref }}- | |
| static-${{ env.MIX_ENV }}-${{ env.CACHE_VERSION }}-refs/heads/master- | |
| - run: mix deps.get | |
| - run: mix compile --warnings-as-errors --all-warnings | |
| - run: mix format --check-formatted | |
| - run: mix deps.unlock --check-unused | |
| - run: mix generate_countries_meta && git diff --exit-code -- assets/data/countries_meta.json | |
| - run: mix credo | |
| - run: mix dialyzer |