diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5c6508d4b..a3c75314b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,58 +3,37 @@ on: branches: - main pull_request: + name: ci jobs: - test: - runs-on: ubuntu-latest + tests: strategy: matrix: node: [18, 20] + os: ['ubuntu-latest', 'windows-latest'] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - - run: node --version - # The first installation step ensures that all of our production - # dependencies work on the given Node.js version, this helps us find - # dependencies that don't match our engines field: - - run: npm install --production --engine-strict --ignore-scripts --no-package-lock - # Clean up the production install, before installing dev/production: - - run: rm -rf node_modules - - run: npm install - - run: npm run test:node${{ matrix.node }} - env: - MOCHA_THROW_DEPRECATION: false - windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm install - - run: npm test - env: - MOCHA_THROW_DEPRECATION: false - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + cache: pnpm + + - run: corepack enable && corepack install + # Note: actions/setup-node doesn't yet provide parameters for corepack, we need to run it again after enabling it - uses: actions/setup-node@v3 with: - node-version: 18 - - run: npm install - - run: npm run lint - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm install - - run: npm run docs - - uses: JustinBeckwith/linkinator-action@v1 - with: - paths: docs/ + node-version: ${{ matrix.node }} + cache: pnpm + + - run: node --version + + - name: Install dependencies + run: pnpm install + + - name: Lint code + run: pnpm lint + + - name: Run tests + run: pnpm test diff --git a/.github/workflows/create-release-prs.yaml b/.github/workflows/create-release-prs.yaml index 111666910..4094689cc 100644 --- a/.github/workflows/create-release-prs.yaml +++ b/.github/workflows/create-release-prs.yaml @@ -11,28 +11,27 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '18' + node-version: 18 + cache: pnpm + - run: corepack enable && corepack install + # Note: actions/setup-node doesn't yet provide parameters for corepack, we need to run it again after enabling it + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: pnpm - name: Install dependencies - run: npm install - - - name: Lint code - run: npm run lint - - - name: Run tests - run: npm run test - - - name: Compile - run: npm run compile + run: pnpm install - name: Create release PRs run: | - npm run cli -- release-pr \ - --token=${{ secrets.GITHUB_TOKEN }} \ - --repo-url=${{ github.repository }} \ - --target-branch=main + pnpm start \ + -- release-pr \ + --token=${{ secrets.GITHUB_TOKEN }} \ + --repo-url=${{ github.repository }} \ + --target-branch=main diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ec0f8b885..90b913ae3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -29,21 +29,22 @@ jobs: git merge --no-ff main - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '18' + node-version: 18 + cache: pnpm + - run: corepack enable && corepack install + # Note: actions/setup-node doesn't yet provide parameters for corepack, we need to run it again after enabling it + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: pnpm - name: Install dependencies - run: npm install - - - name: Lint code - run: npm run lint - - - name: Run tests - run: npm run test + run: pnpm install - name: Compile - run: npm run compile + run: pnpm build - name: Commit and push build directory run: | @@ -53,7 +54,8 @@ jobs: - name: Create github release run: | - npm run cli -- github-release \ - --token=${{ secrets.GITHUB_TOKEN }} \ - --repo-url=${{ github.repository }} \ - --target-branch=release + pnpm start \ + -- github-release \ + --token=${{ secrets.GITHUB_TOKEN }} \ + --repo-url=${{ github.repository }} \ + --target-branch=release