From f816715fc0ed48e6a97f87fc05c53100a9d2e8df Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Tue, 2 Jul 2024 16:37:29 +0200 Subject: [PATCH 1/6] setup-ocaml 3.0.0 --- .github/workflows/ci.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00fc84d38a..208c71ad40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,30 +248,19 @@ jobs: .opam-env D:\cygwin D:\.opam - key: opam-env-v8-${{ matrix.os }}-${{ hashFiles('dune-project') }} + key: opam-env-v10-${{ matrix.os }}-${{ hashFiles('dune-project') }} - name: Use OCaml ${{matrix.ocaml_compiler}} - uses: ocaml/setup-ocaml@v2 - if: steps.cache-opam-env.outputs.cache-hit != 'true' && matrix.os != 'windows-latest' + uses: ocaml/setup-ocaml@v3.0.0 + if: steps.cache-opam-env.outputs.cache-hit != 'true' with: ocaml-compiler: ${{matrix.ocaml_compiler}} + allow-prerelease-opam: true opam-pin: false - opam-depext: false - - - name: Use OCaml ${{matrix.ocaml_compiler}} (Windows) - uses: ocaml/setup-ocaml@v2 - if: steps.cache-opam-env.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' - with: - ocaml-compiler: ocaml-variants.5.2.0+options,ocaml-option-mingw - opam-pin: false - opam-depext: false - opam-repositories: | - windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0 - sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset - default: https://github.com/ocaml/opam-repository.git - name: Get OPAM environment if: steps.cache-opam-env.outputs.cache-hit != 'true' + shell: bash run: | command -v opam | tee .opam-path opam env > .opam-env @@ -292,7 +281,7 @@ jobs: .opam-env D:\cygwin D:\.opam - key: opam-env-v8-${{ matrix.os }}-${{ hashFiles('dune-project') }} + key: opam-env-v10-${{ matrix.os }}-${{ hashFiles('dune-project') }} - name: Use cached OPAM environment if: steps.cache-opam-env.outputs.cache-hit == 'true' @@ -365,6 +354,8 @@ jobs: - name: "Check if syntax subfolder has changed" id: syntax-diff shell: bash + env: + SHELLOPTS: igncr # see https://github.com/ocaml/setup-ocaml/issues/815 run: | if git diff --name-only --exit-code HEAD^ HEAD -- jscomp/syntax; then echo "syntax_status=unchanged" >> $GITHUB_ENV From a3c3571996a5450362257042466c125934f7e365 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 3 Jul 2024 06:55:29 +0200 Subject: [PATCH 2/6] fix --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 208c71ad40..4ec085c0e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -300,12 +300,11 @@ jobs: echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV" fi - if [[ "$RUNNER_OS" != "Windows" ]]; then - OPAM_PATH="$(cat .opam-path)" - chmod +x "$OPAM_PATH" - dirname "$OPAM_PATH" >> "$GITHUB_PATH" + OPAM_PATH="$(cat .opam-path)" + chmod +x "$OPAM_PATH" + dirname "$OPAM_PATH" >> "$GITHUB_PATH" - else + if [[ "$RUNNER_OS" == "Windows" ]]; then fsutil behavior query SymlinkEvaluation fsutil behavior set symlinkEvaluation R2L:1 R2R:1 fsutil behavior query SymlinkEvaluation From 0834ce82c35b8c1eaa97b3b6f47fe9867d25b650 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 3 Jul 2024 07:56:45 +0200 Subject: [PATCH 3/6] which opam --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ec085c0e5..b1f2d017ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -262,7 +262,7 @@ jobs: if: steps.cache-opam-env.outputs.cache-hit != 'true' shell: bash run: | - command -v opam | tee .opam-path + which opam | tee .opam-path opam env > .opam-env - name: Install OPAM dependencies From 04305428ccec2189e8e96ef27f51eca3e16ac6f9 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 3 Jul 2024 21:52:34 +0200 Subject: [PATCH 4/6] opam 2.2.0 final is out --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1f2d017ac..c171bc1429 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -255,7 +255,6 @@ jobs: if: steps.cache-opam-env.outputs.cache-hit != 'true' with: ocaml-compiler: ${{matrix.ocaml_compiler}} - allow-prerelease-opam: true opam-pin: false - name: Get OPAM environment From bf47fdc48896ffbeca9eb977dfee2b8283c26736 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Thu, 4 Jul 2024 22:57:45 +0900 Subject: [PATCH 5/6] fix windows --- .github/workflows/ci.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c171bc1429..a48fd47f30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,6 +187,9 @@ jobs: runs-on: ${{matrix.os}} env: + # setup-ocaml opam version cannot be configured + # we do track its version mannually + OPAM_VERSION: 2.2.0 DUNE_PROFILE: release steps: @@ -245,10 +248,9 @@ jobs: ~/.opam _opam .opam-path - .opam-env D:\cygwin D:\.opam - key: opam-env-v10-${{ matrix.os }}-${{ hashFiles('dune-project') }} + key: opam-env-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }} - name: Use OCaml ${{matrix.ocaml_compiler}} uses: ocaml/setup-ocaml@v3.0.0 @@ -257,12 +259,17 @@ jobs: ocaml-compiler: ${{matrix.ocaml_compiler}} opam-pin: false - - name: Get OPAM environment + - name: Get OPAM executable path if: steps.cache-opam-env.outputs.cache-hit != 'true' - shell: bash - run: | - which opam | tee .opam-path - opam env > .opam-env + uses: actions/github-script@v7 + with: + script: | + const opamPath = await io.which('opam', true); + console.log('opam executable found: %s', opamPath); + + const fs = require('fs/promises'); + await fs.writeFile('.opam-path', opamPath, 'utf-8'); + console.log('stored path to .opam-path'); - name: Install OPAM dependencies if: steps.cache-opam-env.outputs.cache-hit != 'true' @@ -277,10 +284,9 @@ jobs: ~/.opam _opam .opam-path - .opam-env D:\cygwin D:\.opam - key: opam-env-v10-${{ matrix.os }}-${{ hashFiles('dune-project') }} + key: opam-env-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }} - name: Use cached OPAM environment if: steps.cache-opam-env.outputs.cache-hit == 'true' @@ -296,7 +302,7 @@ jobs: if [[ "$RUNNER_OS" != "Windows" ]]; then echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV" else - echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV" + echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV" fi OPAM_PATH="$(cat .opam-path)" From c89ff554026d8a8dc0474a3d9e3ac8c42e97a909 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Fri, 5 Jul 2024 00:14:21 +0900 Subject: [PATCH 6/6] no audit & no scripts for installationTest --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a48fd47f30..976b43e729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -514,7 +514,9 @@ jobs: path: packages/test - name: Install ReScript package - run: npm i rescript-${{ needs.package.outputs.rescript_version }}.tgz + run: | + npm i --ignore-scripts --no-audit \ + rescript-${{ needs.package.outputs.rescript_version }}.tgz shell: bash working-directory: packages/test