From 1bc3b2531a8fb176583c9a458d0be3c183e8bd60 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Wed, 2 Jul 2025 16:34:18 +0200 Subject: [PATCH 1/3] try fixing esy --- .github/workflows/bindings.yml | 28 +++++++++++++++++++++++----- .github/workflows/ppx.yml | 28 ++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 50c1df73..6175b0ac 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -21,12 +21,30 @@ jobs: env: CI: true - name: Install esy - run: npm install -g esy - - name: Build PPX - uses: esy/github-action@6863524ed7748e7882e317e31ac2b8b107011744 + run: npm install -g esy@latest + - name: Install PPX dependencies + working-directory: packages/rescript-relay/rescript-relay-ppx + run: esy install + - name: Print esy cache + id: print_esy_cache + working-directory: packages/rescript-relay/rescript-relay-ppx + run: node $GITHUB_WORKSPACE/.github/workflows/print_esy_cache.js + - name: Try to restore PPX dependencies cache + uses: actions/cache@v4 + id: deps-cache with: - cache-key: ${{ hashFiles('esy.lock/index.json') }} - working-directory: packages/rescript-relay/rescript-relay-ppx + path: ${{ steps.print_esy_cache.outputs.esy_cache }} + key: ubuntu-latest---esy-v2---${{ hashFiles('packages/rescript-relay/rescript-relay-ppx/**/index.json') }} + restore-keys: | + ubuntu-latest---esy-v2--- + ubuntu-latest---esy-v1--- + - name: Build PPX dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' + working-directory: packages/rescript-relay/rescript-relay-ppx + run: esy build-dependencies + - name: Build PPX + working-directory: packages/rescript-relay/rescript-relay-ppx + run: esy build - name: Install run: | yarn --frozen-lockfile diff --git a/.github/workflows/ppx.yml b/.github/workflows/ppx.yml index e11ab456..f5933996 100644 --- a/.github/workflows/ppx.yml +++ b/.github/workflows/ppx.yml @@ -60,6 +60,9 @@ jobs: name: PPX runs-on: ${{ matrix.platform }} + defaults: + run: + working-directory: packages/rescript-relay/rescript-relay-ppx steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -68,15 +71,28 @@ jobs: env: CI: true - name: Install esy - run: npm install -g esy - - name: Build PPX - uses: esy/github-action@6863524ed7748e7882e317e31ac2b8b107011744 + run: npm install -g esy@latest + - name: Install dependencies + run: esy install + - name: Print esy cache + id: print_esy_cache + run: node $GITHUB_WORKSPACE/.github/workflows/print_esy_cache.js + - name: Try to restore dependencies cache + uses: actions/cache@v4 + id: deps-cache with: - cache-key: ${{ matrix.platform }}-${{ hashFiles('esy.lock/index.json') }}-v3 - working-directory: packages/rescript-relay/rescript-relay-ppx + path: ${{ steps.print_esy_cache.outputs.esy_cache }} + key: ${{ matrix.platform }}---esy-v2---${{ hashFiles('**/index.json') }} + restore-keys: | + ${{ matrix.platform }}---esy-v2--- + ${{ matrix.platform }}---esy-v1--- + - name: Build dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' + run: esy build-dependencies + - name: Build PPX + run: esy build - name: Strip PPX binary if: runner.os != 'Windows' - working-directory: packages/rescript-relay/rescript-relay-ppx run: | strip _build/default/bin/RescriptRelayPpxApp.exe - name: Upload PPX artifact ${{ matrix.platform }} From 54de578ad71a13f71e96167e027995e75925bf11 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Wed, 2 Jul 2025 16:45:09 +0200 Subject: [PATCH 2/3] apply fix --- .github/workflows/integration-tests.yml | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index fd12fc5a..e6a34e82 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -24,16 +24,30 @@ jobs: toolchain: 1.76.0 override: true - name: Install esy - run: npm install -g esy - - uses: esy/github-action@6863524ed7748e7882e317e31ac2b8b107011744 + run: npm install -g esy@latest + - name: Install PPX dependencies + working-directory: packages/rescript-relay/rescript-relay-ppx + run: esy install + - name: Print esy cache + id: print_esy_cache + working-directory: packages/rescript-relay/rescript-relay-ppx + run: node $GITHUB_WORKSPACE/.github/workflows/print_esy_cache.js + - name: Try to restore PPX dependencies cache + uses: actions/cache@v4 + id: deps-cache with: - cache-key: ${{ hashFiles('esy.lock/index.json') }} - working-directory: packages/rescript-relay/rescript-relay-ppx + path: ${{ steps.print_esy_cache.outputs.esy_cache }} + key: macos-latest---esy-v2---${{ hashFiles('packages/rescript-relay/rescript-relay-ppx/**/index.json') }} + restore-keys: | + macos-latest---esy-v2--- + macos-latest---esy-v1--- + - name: Build PPX dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' + working-directory: packages/rescript-relay/rescript-relay-ppx + run: esy build-dependencies - name: Build PPX - uses: esy/github-action@6863524ed7748e7882e317e31ac2b8b107011744 - with: - cache-key: ${{ hashFiles('esy.lock/index.json') }} - working-directory: packages/rescript-relay/rescript-relay-ppx + working-directory: packages/rescript-relay/rescript-relay-ppx + run: esy build - name: Install - bindings working-directory: packages/rescript-relay run: | From 3ee0651a61628b4771654a4cbc9bb4aacfdb59ad Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Wed, 2 Jul 2025 16:55:45 +0200 Subject: [PATCH 3/3] try new approach --- .github/workflows/bindings.yml | 19 +------------------ .github/workflows/integration-tests.yml | 19 +------------------ .github/workflows/ppx.yml | 17 +---------------- 3 files changed, 3 insertions(+), 52 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 6175b0ac..55bd6048 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -22,26 +22,9 @@ jobs: CI: true - name: Install esy run: npm install -g esy@latest - - name: Install PPX dependencies + - name: Install and build PPX dependencies working-directory: packages/rescript-relay/rescript-relay-ppx run: esy install - - name: Print esy cache - id: print_esy_cache - working-directory: packages/rescript-relay/rescript-relay-ppx - run: node $GITHUB_WORKSPACE/.github/workflows/print_esy_cache.js - - name: Try to restore PPX dependencies cache - uses: actions/cache@v4 - id: deps-cache - with: - path: ${{ steps.print_esy_cache.outputs.esy_cache }} - key: ubuntu-latest---esy-v2---${{ hashFiles('packages/rescript-relay/rescript-relay-ppx/**/index.json') }} - restore-keys: | - ubuntu-latest---esy-v2--- - ubuntu-latest---esy-v1--- - - name: Build PPX dependencies - if: steps.deps-cache.outputs.cache-hit != 'true' - working-directory: packages/rescript-relay/rescript-relay-ppx - run: esy build-dependencies - name: Build PPX working-directory: packages/rescript-relay/rescript-relay-ppx run: esy build diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e6a34e82..cac664e9 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -25,26 +25,9 @@ jobs: override: true - name: Install esy run: npm install -g esy@latest - - name: Install PPX dependencies + - name: Install and build PPX dependencies working-directory: packages/rescript-relay/rescript-relay-ppx run: esy install - - name: Print esy cache - id: print_esy_cache - working-directory: packages/rescript-relay/rescript-relay-ppx - run: node $GITHUB_WORKSPACE/.github/workflows/print_esy_cache.js - - name: Try to restore PPX dependencies cache - uses: actions/cache@v4 - id: deps-cache - with: - path: ${{ steps.print_esy_cache.outputs.esy_cache }} - key: macos-latest---esy-v2---${{ hashFiles('packages/rescript-relay/rescript-relay-ppx/**/index.json') }} - restore-keys: | - macos-latest---esy-v2--- - macos-latest---esy-v1--- - - name: Build PPX dependencies - if: steps.deps-cache.outputs.cache-hit != 'true' - working-directory: packages/rescript-relay/rescript-relay-ppx - run: esy build-dependencies - name: Build PPX working-directory: packages/rescript-relay/rescript-relay-ppx run: esy build diff --git a/.github/workflows/ppx.yml b/.github/workflows/ppx.yml index f5933996..92120d19 100644 --- a/.github/workflows/ppx.yml +++ b/.github/workflows/ppx.yml @@ -72,23 +72,8 @@ jobs: CI: true - name: Install esy run: npm install -g esy@latest - - name: Install dependencies + - name: Install and build dependencies run: esy install - - name: Print esy cache - id: print_esy_cache - run: node $GITHUB_WORKSPACE/.github/workflows/print_esy_cache.js - - name: Try to restore dependencies cache - uses: actions/cache@v4 - id: deps-cache - with: - path: ${{ steps.print_esy_cache.outputs.esy_cache }} - key: ${{ matrix.platform }}---esy-v2---${{ hashFiles('**/index.json') }} - restore-keys: | - ${{ matrix.platform }}---esy-v2--- - ${{ matrix.platform }}---esy-v1--- - - name: Build dependencies - if: steps.deps-cache.outputs.cache-hit != 'true' - run: esy build-dependencies - name: Build PPX run: esy build - name: Strip PPX binary