From 659d3917a80fc52d399ee3736b44a3febeda40a1 Mon Sep 17 00:00:00 2001 From: Jeremy Ortiz Date: Thu, 31 Aug 2023 21:34:48 +1000 Subject: [PATCH] feature(ci): move test ci to github actions, add version and update release scripts --- .circleci/config.yml | 40 ----------------------------- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 48 +++++++++++++++++++++++++++++++++++ .github/workflows/version.yml | 47 ++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 41 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/version.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index af16baa74..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: 2.1 - -jobs: - build_and_test: - docker: - - image: node:18 - resource_class: large - parallelism: 10 - - steps: - - checkout - - restore_cache: - name: Restore pnpm Package Cache - keys: - - pnpm-packages-{{ checksum "pnpm-lock.yaml" }} - - run: - name: Install pnpm package manager - command: | - corepack enable - corepack prepare pnpm@latest-8 --activate - - run: - name: Install Dependencies - command: | - pnpm install --frozen-lockfile - - save_cache: - name: Save pnpm Package Cache - key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }} - paths: - - node_modules - - run: - name: Run build - command: pnpm build - - run: - name: Run tests - command: pnpm ci:test - -workflows: - gel-next-build-test: - jobs: - - build_and_test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed498b9d4..a3d1186f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Create Release Pull Request or Publish to npm + - name: Publish to npm uses: changesets/action@v1 with: publish: pnpm ci:publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..4dbdf71ba --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: Test + +on: + pull_request: + branches: + - develop + - main + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + registry-url: 'https://registry.npmjs.org' + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8.2.0 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run build + run: pnpm build + + - name: Run tests + run: pnpm ci:test diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 000000000..344856e75 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,47 @@ +name: Version + +on: + push: + branches: + - develop + workflow_dispatch: + +jobs: + version: + name: Version + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + registry-url: 'https://registry.npmjs.org' + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8.2.0 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Create Release Pull Request + uses: changesets/action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}