From 6faeb5a15a7aed74ae91117a492e9ea95dda4f4e Mon Sep 17 00:00:00 2001 From: Daniel Rivers Date: Mon, 18 Nov 2024 15:09:42 +0000 Subject: [PATCH] ci: add workflow --- .github/workflows/build-test-ci.yml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build-test-ci.yml diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml new file mode 100644 index 0000000..36b7d56 --- /dev/null +++ b/.github/workflows/build-test-ci.yml @@ -0,0 +1,37 @@ +name: Build and test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + main: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v3 + with: + version: 8 + - name: Setting up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - name: Enabling pre-post scripts + run: pnpm config set enable-pre-post-scripts true + - run: pnpm install + - run: pnpm lint + - name: Cache pnpm modules + uses: actions/cache@v4 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + - run: pnpm build + - run: pnpm test:coverage