neiam
/waxx
waxx
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
CI: tests on the forge too; public registries kept, commented
8126e1c · Gabe Morell · 2026-10-27 02:45
Message
{commit_body(@commit)}
Files changed
modified
.forgejo/workflows/image.yml
+96
−5
@@ -6,19 +6,82 @@
| 6 | 6 | # No secrets. The forge injects CI_REGISTRY and accepts the per-job |
| 7 | 7 | # github.token for push to this repository's own image path. |
| 8 | 8 | # |
| 9 | −# No test gate: this workflow can't `needs:` ci.yml's test job (mix precommit), | |
| 10 | −# and the Dockerfile compiles the release itself. | |
| 11 | −name: image | |
| 9 | +# Tests gate the image, as on GitHub: ci.yml's test job (mix precommit) is | |
| 10 | +# copied in above the image job, guarded to the forge. The .github copies | |
| 11 | +# of those jobs are skipped here, so they run once. | |
| 12 | +name: ci (forge) | |
| 12 | 13 | |
| 13 | 14 | on: |
| 14 | 15 | push: |
| 15 | 16 | branches: [master] |
| 16 | 17 | tags: ['v*'] |
| 18 | + pull_request: | |
| 17 | 19 | workflow_dispatch: |
| 18 | 20 | |
| 19 | 21 | jobs: |
| 20 | − image: | |
| 22 | + test: | |
| 21 | 23 | if: github.server_url != 'https://github.com' |
| 24 | + # Self-hosted ARC runners (same as ../angler). Swap for `ubuntu-latest` | |
| 25 | + # if you'd rather use GitHub-hosted runners. The Postgres service container | |
| 26 | + # requires the runner to support service containers (Docker/dind). | |
| 27 | + runs-on: arc-runner-set | |
| 28 | + env: | |
| 29 | + MIX_ENV: test | |
| 30 | + # Under forgejo-runner/act the job runs in a container, so the postgres | |
| 31 | + # service is reached by its service name, not localhost. | |
| 32 | + POSTGRES_HOST: postgres | |
| 33 | + # service is reached at its container port under forgejo-runner | |
| 34 | + POSTGRES_PORT: 5432 | |
| 35 | + # Cap the test DB pool below the Postgres service's default | |
| 36 | + # max_connections (100); big CI runners otherwise scale pool to cores×2 | |
| 37 | + # and exhaust connections. | |
| 38 | + POOL_SIZE: "40" | |
| 39 | + services: | |
| 40 | + postgres: | |
| 41 | + image: docker.io/postgres:16-alpine | |
| 42 | + env: | |
| 43 | + POSTGRES_USER: postgres | |
| 44 | + POSTGRES_PASSWORD: postgres | |
| 45 | + # config/test.exs connects on 54328 (matches compose.yml), so publish | |
| 46 | + # the service container's 5432 on that host port. | |
| 47 | + ports: | |
| 48 | + - 54328:5432 | |
| 49 | + options: >- | |
| 50 | + --health-cmd "pg_isready -U postgres" | |
| 51 | + --health-interval 5s | |
| 52 | + --health-timeout 3s | |
| 53 | + --health-retries 5 | |
| 54 | + steps: | |
| 55 | + - uses: actions/checkout@v4 | |
| 56 | + | |
| 57 | + # ARC's default runner image is bare; install the toolchain needed to | |
| 58 | + # compile native deps. | |
| 59 | + - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make build-essential | |
| 60 | + # Forge fork of erlef/setup-beam: defaults ImageOS to ubuntu-24.04, | |
| 61 | + # since forgejo/act injects an unmappable ImageOS from the runs-on label. | |
| 62 | + - uses: https://gg.neiam.co/neiam/action-setup-beam@v1 | |
| 63 | + with: | |
| 64 | + # Match the build image in the Dockerfile (OTP must be >= 27.3.3). | |
| 65 | + elixir-version: "1.20.4" | |
| 66 | + otp-version: "28.5.0.8" | |
| 67 | + | |
| 68 | + - uses: actions/cache@v4 | |
| 69 | + with: | |
| 70 | + path: | | |
| 71 | + deps | |
| 72 | + _build | |
| 73 | + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
| 74 | + restore-keys: ${{ runner.os }}-mix- | |
| 75 | + | |
| 76 | + - run: mix deps.get | |
| 77 | + | |
| 78 | + # `mix precommit` = compile --warnings-as-errors, deps.unlock --unused, | |
| 79 | + # format, test (which creates + migrates the test DB). | |
| 80 | + - run: mix precommit | |
| 81 | + | |
| 82 | + image: | |
| 83 | + needs: [test] | |
| 84 | + if: github.server_url != 'https://github.com' && github.event_name != 'pull_request' | |
| 22 | 85 | runs-on: arc-runner-set |
| 23 | 86 | permissions: |
| 24 | 87 | contents: read |
@@ -36,10 +99,38 @@ jobs:
| 36 | 99 | username: gitgud-actions |
| 37 | 100 | password: ${{ github.token }} |
| 38 | 101 | |
| 102 | + # Public registries, off on the forge (GitHub pushes them). To push | |
| 103 | + # from here too, uncomment these logins and the extra `images:` lines. | |
| 104 | + # - name: Log in to GHCR | |
| 105 | + # uses: docker/login-action@v3 | |
| 106 | + # with: | |
| 107 | + # registry: ghcr.io | |
| 108 | + # username: ${{ vars.GHCR_USER || github.actor }} | |
| 109 | + # password: ${{ secrets.GHCR_TOKEN }} | |
| 110 | + # | |
| 111 | + # - name: Log in to Docker Hub | |
| 112 | + # uses: docker/login-action@v3 | |
| 113 | + # with: | |
| 114 | + # registry: docker.io | |
| 115 | + # username: ${{ secrets.DOCKERHUB_USER }} | |
| 116 | + # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| 117 | + # | |
| 118 | + # - name: Log in to Quay | |
| 119 | + # uses: docker/login-action@v3 | |
| 120 | + # with: | |
| 121 | + # registry: quay.io | |
| 122 | + # username: ${{ secrets.QUAY_USERNAME }} | |
| 123 | + # password: ${{ secrets.QUAY_TOKEN }} | |
| 124 | + | |
| 39 | 125 | - id: meta |
| 40 | 126 | uses: docker/metadata-action@v5 |
| 41 | 127 | with: |
| 42 | − images: ${{ vars.CI_REGISTRY }}/${{ github.repository }} | |
| 128 | + # metadata-action skips '#' lines in its inputs. | |
| 129 | + images: | | |
| 130 | + ${{ vars.CI_REGISTRY }}/${{ github.repository }} | |
| 131 | + # ghcr.io/${{ github.repository }} | |
| 132 | + # docker.io/neiam/waxx | |
| 133 | + # quay.io/neiam/waxx | |
| 43 | 134 | tags: | |
| 44 | 135 | type=ref,event=branch |
| 45 | 136 | type=semver,pattern={{version}} |
modified
.github/workflows/ci.yml
+2
−0
@@ -7,7 +7,9 @@ on:
| 7 | 7 | pull_request: |
| 8 | 8 | |
| 9 | 9 | jobs: |
| 10 | + # GitHub only; the forge runs its copy in .forgejo/workflows/image.yml. | |
| 10 | 11 | test: |
| 12 | + if: github.server_url == 'https://github.com' | |
| 11 | 13 | # Self-hosted ARC runners (same as ../angler). Swap for `ubuntu-latest` |
| 12 | 14 | # if you'd rather use GitHub-hosted runners. The Postgres service container |
| 13 | 15 | # requires the runner to support service containers (Docker/dind). |
Parents: 920fa72