diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33460f1bcccc..9a3f7a5372a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,11 @@ name: CI on: push: - branches: [ master ] + branches: [master] pull_request: permissions: contents: read # to fetch code (actions/checkout) -env: - # We only install Chromium manually - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' - jobs: Tests: runs-on: ${{ matrix.os }} @@ -28,14 +24,9 @@ jobs: - node-version: 20 os: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2.2.4 - - uses: actions/setup-node@v3 + - uses: ./.github/workflows/setup.yml with: node-version: ${{ matrix.node-version }} - cache: pnpm - - run: pnpm install --frozen-lockfile - - run: pnpm playwright install chromium - run: pnpm test env: CI: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d311bff110c2..55d3f88dcac3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,19 +16,7 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits - fetch-depth: 0 - - uses: pnpm/action-setup@v2.2.4 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: pnpm - - - run: pnpm install --frozen-lockfile + - uses: ./.github/workflows/setup.yml - name: Create Release Pull Request or Publish to npm id: changesets diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 000000000000..ddabdb996760 --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,24 @@ +on: + workflow-call: + inputs: + node-version: + description: 'Node.js version' + required: false + default: 18 + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + # We only install Chromium manually + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' + +jobs: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2.2.4 + - uses: actions/setup-node@v3 + with: + node-version: ${{ github.event.inputs.node-version }} + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm playwright install chromium