Skip to content

Run integration tests on host runner in CI - #6831

Open
rhcarvalho wants to merge 1 commit into
phoenixframework:mainfrom
praialabs:integration-test-ci-host-runner
Open

Run integration tests on host runner in CI#6831
rhcarvalho wants to merge 1 commit into
phoenixframework:mainfrom
praialabs:integration-test-ci-host-runner

Conversation

@rhcarvalho

Copy link
Copy Markdown
Contributor

Migrate the integration-test-elixir workflow job from an Alpine Docker container to run directly on the ubuntu-24.04 host runner using erlef/setup-beam, matching the environment of mix_test, installer_test, and docs.

Key benefits:

  • Adds actions/cache for integration_test/deps and integration_test/_build keyed on integration_test/mix.lock. This avoids recompiling ~50 dependencies on every CI run, saving ~50s of setup time on warm caches.
  • Eliminates the apk add system package installation step, as build tools are pre-installed on the Ubuntu runner image.
  • Removes background socat proxy bridges; GitHub Actions binds database service container ports directly to localhost.

Migrate the `integration-test-elixir` workflow job from an Alpine Docker
container to run directly on the `ubuntu-24.04` host runner using
`erlef/setup-beam`, matching the environment of `mix_test`,
`installer_test`, and `docs`.

Key benefits:

- Adds `actions/cache` for `integration_test/deps` and
  `integration_test/_build` keyed on `integration_test/mix.lock`. This
  avoids recompiling ~50 dependencies on every CI run, saving ~50s of
  setup time on warm caches.
- Eliminates the `apk add` system package installation step, as build
  tools are pre-installed on the Ubuntu runner image.
- Removes background `socat` proxy bridges; GitHub Actions binds
  database service container ports directly to `localhost`.
@rhcarvalho
rhcarvalho force-pushed the integration-test-ci-host-runner branch from cedbe41 to 817b85b Compare September 2, 2026 21:06
@rhcarvalho

Copy link
Copy Markdown
Contributor Author

CI run with

Note how the "Compile dependencies" step went from 41s down to 11s (some deps still recompiled)

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

We're also shaving ~10-20s for not having to pull/setup the Alpine container.

@rhcarvalho
rhcarvalho marked this pull request as ready for review September 2, 2026 21:16
@rhcarvalho

Copy link
Copy Markdown
Contributor Author

For reference, the next optimization on top of this would be a small patch to use tmpfs for installer/tmp and integration_test/tmp to improve IO performance.

diff
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c9de83067..aef4d6acd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -96,6 +96,11 @@ jobs:
         with:
           persist-credentials: false

+      - name: Mount installer/tmp on tmpfs
+        run: |
+          mkdir -p installer/tmp
+          sudo mount -t tmpfs -o size=2G,uid=$(id -u),gid=$(id -g) tmpfs installer/tmp
+
       - name: Set up Elixir
         uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
         with:
@@ -289,6 +294,11 @@ jobs:
         with:
           persist-credentials: false

+      - name: Mount installer/tmp on tmpfs
+        run: |
+          mkdir -p installer/tmp
+          sudo mount -t tmpfs -o size=2G,uid=$(id -u),gid=$(id -g) tmpfs installer/tmp
+
       - name: Set up Elixir
         uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1```

@SteffenDE

Copy link
Copy Markdown
Member

@rhcarvalho feel free to go ahead and include the tmpfs mount here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants