Skip to content

feat: Upgrade ci dependencies #600

feat: Upgrade ci dependencies

feat: Upgrade ci dependencies #600

Workflow file for this run

name: Esy
on:
push:
branches: [main]
pull_request:
# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
env:
ESY__PREFIX: ${{ github.workspace }}/.esy/
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
check-latest: true
# Install `esy` to build the project
# It also adds `shx` globally for cross-platform shell commands
- name: Setup environment
run: |
npm i -g esy@0.9.2
npm i -g shx
- name: Checkout project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: Install local dependencies
run: |
esy install
- name: Esy cache
id: esy-cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: _export
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
- name: Import esy cache
if: steps.esy-cache.outputs.cache-hit == 'true'
run: |
esy import-dependencies _export
shx rm -rf _export
# Build the project in release to make sure deps are specified correctly
- name: Build release dependencies
if: steps.esy-cache.outputs.cache-hit != 'true'
run: |
esy build-dependencies --release
- name: Build project in release
run: |
esy build --release
# Then build in non-release so we can test
- name: Build dependencies
if: steps.esy-cache.outputs.cache-hit != 'true'
run: |
esy build-dependencies
- name: Build project
run: |
esy build
# Re-export dependencies if anything has changed or if it is the first time
- name: Build esy cache
if: steps.esy-cache.outputs.cache-hit != 'true'
run: |
esy export-dependencies
- name: Run tests
run: |
esy test