Skip to content

Commit b0af8e0

Browse files
committed
Skip package management if running in github-hosted container
GitHub allows running actions in containers [1] on the runners, and when using a non apt-based Linux distribution, setup-ocaml doesn't work correctly. This commit skips package management on docker containers, similar to the behavior on self-hosted runners. [1]: https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/running-jobs-in-a-container
1 parent 5bbf7d2 commit b0af8e0

File tree

3 files changed

+526
-469
lines changed

3 files changed

+526
-469
lines changed

.github/workflows/workflow.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,31 @@ jobs:
7777
allow-prerelease-opam: ${{ matrix.allow-prerelease-opam }}
7878

7979
- run: opam install ssl
80+
81+
test-container:
82+
name: Test on a container in a GitHub runner
83+
84+
needs: hygiene
85+
86+
runs-on: ubuntu-24.04
87+
88+
container:
89+
image: archlinux:latest
90+
91+
steps:
92+
- name: Checkout tree
93+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94+
95+
- name: Install pre-requisites
96+
run: |
97+
pacman -Sy --noconfirm make gcc patch tar ca-certificates git \
98+
rsync curl sudo bash nano coreutils xz ncurses diffutils \
99+
unzip
100+
101+
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
102+
uses: ./
103+
with:
104+
ocaml-compiler: "5.3"
105+
opam-disable-sandboxing: true
106+
107+
- run: opam install ssl

0 commit comments

Comments
 (0)