From 7f277f07f87f9f834a944ffeec3e51c32b5c7d65 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sun, 8 Sep 2024 13:02:06 +0200 Subject: [PATCH 1/2] Sample bun CI. --- .github/workflows/bun.yml | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/bun.yml diff --git a/.github/workflows/bun.yml b/.github/workflows/bun.yml new file mode 100644 index 000000000..bff091358 --- /dev/null +++ b/.github/workflows/bun.yml @@ -0,0 +1,40 @@ +name: Bun CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + bun-version: [1.1.21, latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - name: Get bun cache dir and hash + id: bunCache + run: | + echo "dir=$(bun pm cache)" >> $GITHUB_OUTPUT + echo "hash=$(bun pm hash)" >> $GITHUB_OUTPUT + - name: Cache node modules + uses: actions/cache@v4 + with: + path: ${{ steps.bunCache.outputs.dir }} + key: ${{ runner.os }}-build-cache-bun-${{ steps.bunCache.outputs.hash }} + - name: Install dependencies + run: bun install + - name: Lint + run: bun run lint + - name: Test + run: bun run test + - name: Build + run: bun run build From bb4eaaa2738c0a0e48a86bbea9bc59db6b5fb7a7 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Sun, 8 Sep 2024 13:03:33 +0200 Subject: [PATCH 2/2] involve bun version. --- .github/workflows/bun.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bun.yml b/.github/workflows/bun.yml index bff091358..4b46a583e 100644 --- a/.github/workflows/bun.yml +++ b/.github/workflows/bun.yml @@ -19,7 +19,7 @@ jobs: - name: Install bun uses: oven-sh/setup-bun@v2 with: - bun-version: latest + bun-version: ${{ matrix.bun-version }} - name: Get bun cache dir and hash id: bunCache run: | @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.bunCache.outputs.dir }} - key: ${{ runner.os }}-build-cache-bun-${{ steps.bunCache.outputs.hash }} + key: ${{ runner.os }}-build-cache-bun-${{ matrix.bun-version }}-${{ steps.bunCache.outputs.hash }} - name: Install dependencies run: bun install - name: Lint