Skip to content

Commit 999cb79

Browse files
punchagansmorimoto
authored andcommitted
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 8937597 commit 999cb79

File tree

3 files changed

+205
-177
lines changed

3 files changed

+205
-177
lines changed

.github/workflows/workflow.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,28 @@ permissions: read-all
1212
jobs:
1313
hygiene:
1414
name: Hygiene
15-
1615
runs-on: ubuntu-latest
17-
1816
steps:
1917
- name: Checkout tree
2018
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21-
2219
- name: Set-up Node.js
2320
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2421
with:
2522
check-latest: true
2623
node-version-file: .nvmrc
27-
2824
- run: corepack enable
29-
3025
- run: yarn install --immutable
31-
3226
- if: always()
3327
run: yarn lint
34-
3528
- if: always()
3629
run: yarn typecheck
37-
3830
- name: Ensure dist directory is up-to-date
3931
if: always()
4032
run: yarn build && git diff --exit-code --ignore-cr-at-eol
4133

4234
test:
4335
name: Test
44-
4536
needs: hygiene
46-
4737
strategy:
4838
fail-fast: false
4939
matrix:
@@ -63,17 +53,30 @@ jobs:
6353
- os: ubuntu-24.04
6454
ocaml-compiler: "5.3"
6555
allow-prerelease-opam: true
66-
6756
runs-on: ${{ matrix.os }}
68-
6957
steps:
7058
- name: Checkout tree
7159
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
72-
7360
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
7461
uses: ./
7562
with:
7663
ocaml-compiler: ${{ matrix.ocaml-compiler }}
7764
allow-prerelease-opam: ${{ matrix.allow-prerelease-opam }}
65+
- run: opam install ssl
7866

67+
test-container:
68+
name: Test on a container in a GitHub runner
69+
needs: hygiene
70+
runs-on: ubuntu-latest
71+
container:
72+
image: archlinux:latest
73+
steps:
74+
- name: Checkout tree
75+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76+
- name: Install dependencies
77+
run: pacman -Sy --noconfirm make gcc patch tar ca-certificates git rsync curl sudo bash nano coreutils xz ncurses diffutils unzip bubblewrap
78+
- name: Set-up OCaml
79+
uses: ./
80+
with:
81+
ocaml-compiler: "5.3"
7982
- run: opam install ssl

0 commit comments

Comments
 (0)