Skip to content

Commit

Permalink
[ci] build and test with both ocaml 4 and 5 on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Sep 14, 2023
1 parent f0660c0 commit d04876d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ jobs:
env:
PLATFORM: linux64
OPAMYES: 1
strategy:
fail-fast: false
matrix:
ocaml: ["4.08.1", "5.0.0"]
steps:
- uses: actions/checkout@main
with:
Expand All @@ -269,7 +273,7 @@ jobs:
uses: actions/[email protected]
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}-2
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}

- name: Install Neko from S3
run: |
Expand Down Expand Up @@ -303,6 +307,7 @@ jobs:
set -ex
opam init # --disable-sandboxing
opam update
opam switch create ${{ matrix.ocaml }}
opam pin add haxe . --no-action
opam install haxe --deps-only --assume-depexts
opam list
Expand Down Expand Up @@ -343,11 +348,12 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: linuxBinaries
name: linuxBinaries${{ (matrix.ocaml == '5.0.0' && '_ocaml5') || '' }}
path: out

- name: Upload xmldoc artifact
uses: actions/upload-artifact@v3
if: matrix.ocaml == '4.08.1'
with:
name: xmldoc
path: extra/doc
Expand All @@ -363,6 +369,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ocaml: ["4.08.1", "5.0.0"]
target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash, neko]
include:
- target: hl
Expand All @@ -379,7 +386,7 @@ jobs:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: linuxBinaries
name: linuxBinaries${{ (matrix.ocaml == '5.0.0' && '_ocaml5') || '' }}
path: linuxBinaries

- name: Install Neko from S3
Expand Down Expand Up @@ -586,7 +593,7 @@ jobs:
uses: actions/[email protected]
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}-2
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}

- name: Install Neko from S3
run: |
Expand Down
6 changes: 0 additions & 6 deletions extra/github-actions/cache-opam-windows.yml

This file was deleted.

6 changes: 0 additions & 6 deletions extra/github-actions/cache-opam.yml

This file was deleted.

27 changes: 23 additions & 4 deletions extra/github-actions/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,22 @@ jobs:
env:
PLATFORM: linux64
OPAMYES: 1
strategy:
fail-fast: false
matrix:
ocaml: ["4.08.1", "5.0.0"]
steps:
- uses: actions/checkout@main
with:
submodules: recursive

@import cache-opam.yml
- name: Cache opam
id: cache-opam
uses: actions/[email protected]
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}

@import install-neko-unix.yml

- name: Install dependencies
Expand All @@ -79,6 +89,7 @@ jobs:
set -ex
opam init # --disable-sandboxing
opam update
opam switch create ${{ matrix.ocaml }}
opam pin add haxe . --no-action
opam install haxe --deps-only --assume-depexts
opam list
Expand Down Expand Up @@ -119,11 +130,12 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: linuxBinaries
name: linuxBinaries${{ (matrix.ocaml == '5.0.0' && '_ocaml5') || '' }}
path: out

- name: Upload xmldoc artifact
uses: actions/upload-artifact@v3
if: matrix.ocaml == '4.08.1'
with:
name: xmldoc
path: extra/doc
Expand All @@ -139,6 +151,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ocaml: ["4.08.1", "5.0.0"]
target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash, neko]
include:
- target: hl
Expand All @@ -155,7 +168,7 @@ jobs:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: linuxBinaries
name: linuxBinaries${{ (matrix.ocaml == '5.0.0' && '_ocaml5') || '' }}
path: linuxBinaries

@import install-neko-unix.yml
Expand Down Expand Up @@ -325,7 +338,13 @@ jobs:
with:
submodules: recursive

@import cache-opam.yml
- name: Cache opam
id: cache-opam
uses: actions/[email protected]
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}

@import install-neko-unix.yml
@import build-mac.yml

Expand Down

0 comments on commit d04876d

Please sign in to comment.