From 04f742900443999ec4c3a485a21f2afe7abedbe4 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:07:40 +0200 Subject: [PATCH] feat(CI): matrix tests of compatibility with Blueprint chore: CHANGELOG fix: add the preparation step fix: corepack & bun setup fix: pnpm and npm --- .github/workflows/tact.yml | 72 ++++++++++++++++++++++++++++++++++++-- CHANGELOG.md | 2 ++ 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tact.yml b/.github/workflows/tact.yml index 416f8565c..f0340a2dd 100644 --- a/.github/workflows/tact.yml +++ b/.github/workflows/tact.yml @@ -161,10 +161,78 @@ jobs: yarn build yarn test - - name: Test compatibility with Blueprint + test-blueprint: + strategy: + fail-fast: false + matrix: + node-version: [22] + os: [ubuntu-latest, windows-latest, macos-latest] + package-manager: [npm, yarn, pnpm, bun] + # follow-up ifs are for ensuring clean state at all times + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "yarn" # dependency caching only + + - uses: oven-sh/setup-bun@v2 + if: ${{ matrix.package-manager == 'bun' }} + + - name: Prepare Tact compiler + run: | + # There are issues with corepack + it disallows the use of pnpm for linkage later on + # It's only useful for making sure that Tact compiler developers use the same version of Yarn + # https://github.com/nodejs/corepack/issues/112 + # corepack enable + yarn install + yarn clean + yarn gen + yarn build + + - name: (npm) Test compatibility with Blueprint + if: ${{ matrix.package-manager == 'npm' }} + run: | + npm link && + npm create -y ton@latest -- test-project --type tact-counter --contractName Counter && + cd test-project && + npm link @tact-lang/compiler && + npm run build && + npm run test + + - name: (yarn) Test compatibility with Blueprint + if: ${{ matrix.package-manager == 'yarn' }} run: | - yarn create ton -- test-project --type tact-counter --contractName Counter && + yarn link && + yarn create ton test-project --type tact-counter --contractName Counter && cd test-project && yarn link @tact-lang/compiler && yarn build && yarn test + + - name: (pnpm) Test compatibility with Blueprint + if: ${{ matrix.package-manager == 'pnpm' }} + run: | + npm i -g pnpm && + pnpm link -g && + pnpm create ton@latest test-project --type tact-counter --contractName Counter && + cd test-project && + pnpm link -g @tact-lang/compiler && + pnpm build && + pnpm test + + - name: (bun) Test compatibility with Blueprint + if: ${{ matrix.package-manager == 'bun' }} + run: | + bun link && + bun create ton@latest test-project --type tact-counter --contractName Counter && + cd test-project && + bun link @tact-lang/compiler && + bun run build && # without 'run' Bun will use its own bundler + bun run test # without 'run' Bun will use its own test runner diff --git a/CHANGELOG.md b/CHANGELOG.md index a7116f6ca..4dc380bf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- CI now does matrix tests with [Blueprint](https://github.com/ton-org/blueprint) and `npm`, `yarn`, `pnpm`, and `bun` package managers: PR [#848](https://github.com/tact-lang/tact/pull/848) + ### Fixed ## [1.5.0] - 2024-09-15