Skip to content

Commit

Permalink
Better names for CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed May 21, 2024
1 parent 05f78c7 commit 21d9052
Showing 1 changed file with 22 additions and 31 deletions.
53 changes: 22 additions & 31 deletions .github/workflows/main.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ jobs:
lint-pull-request:
name: Lint
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
node: [20.x]
steps:
- name: Setup node v${{ matrix.node }}
- name: Setup node v20.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
node-version: 20.x

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -31,7 +27,7 @@ jobs:
- name: Cache node_modules
uses: actions/cache@v4
with:
key: ${{ runner.os }}-node_modules-${{ matrix.node }}-${{ hashFiles('package.json', 'yarn.lock') }}
key: ${{ join(fromJSON('["${{ runner.os }}", "node_modules", "20.x", "${{ hashFiles('package.json', 'yarn.lock') }"]', '-') }}
path: node_modules

- name: Check if source or test files changed
Expand All @@ -51,14 +47,14 @@ jobs:
build-and-test-pull-request:
needs:
- lint-pull-request
name: Test
name: Test ${{ matrix.node }} ${{ join(fromJSON('["${{ matrix.target }}", "${{ matrix.module }}"]'), '/') }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node: [16.x, 18.x, 20.x]
module: [cjs, esm, umd]
target: [es5, es2015, esnext]
module: [cjs, esm, umd]
include:
- {node: 16.x, target: ix}
- {node: 18.x, target: ix}
Expand All @@ -77,13 +73,13 @@ jobs:
- name: Cache targets
uses: actions/cache@v4
with:
key: ${{ runner.os }}-targets-${{ matrix.node }}-${{ matrix.target }}-${{ matrix.module }}-${{ hashFiles('package.json', 'yarn.lock', 'src/**/*') }}
key: ${{ join(fromJSON('["${{ runner.os }}", "targets", "${{ matrix.node }}", "${{ matrix.target }}", "${{ matrix.module }}", "${{ hashFiles('package.json', 'yarn.lock', 'tsconfig.json', 'src/**/*', 'tsconfigs/**/*') }}"]'), '-') }}
path: targets

- name: Cache node_modules
uses: actions/cache@v4
with:
key: ${{ runner.os }}-node_modules-${{ matrix.node }}-${{ hashFiles('package.json', 'yarn.lock') }}
key: ${{ join(fromJSON('["${{ runner.os }}", "node_modules", "${{ matrix.node }}", "${{ hashFiles('package.json', 'yarn.lock') }}"]'), '-') }}
path: node_modules

- name: Check if test files changed
Expand All @@ -92,6 +88,10 @@ jobs:
with:
files: |
spec/**/*
tsconfig.json
tsconfigs/**/*
jest.config.js
jestconfigs/**/*
- name: Check if source files changed
id: source_files_changed
Expand All @@ -101,7 +101,10 @@ jobs:
.npmrc
yarn.lock
package.json
tsconfig.json
src/**/*
gulp/**/*
tsconfigs/**/*
integration/**/*
- name: Install dependencies
Expand Down Expand Up @@ -158,18 +161,18 @@ jobs:
test-tree-shaking-pull-request:
needs:
- build-and-test-pull-request
name: Integration
name: Bundle ${{ matrix.bundler }} ${{ join(fromJSON('["${{ matrix.target }}", "${{ matrix.module }}"]'), '/') }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
module: [cjs, esm, umd]
target: [es5, es2015, esnext]
bundler: [esbuild, rollup, webpack]
target: [es5, es2015, esnext]
module: [cjs, esm, umd]
include:
- {target: ix, bundler: esbuild}
- {target: ix, bundler: rollup}
- {target: ix, bundler: webpack}
- {bundler: esbuild, target: ix}
- {bundler: rollup, target: ix}
- {bundler: webpack, target: ix}
steps:
- name: Setup node v20.x
uses: actions/setup-node@v4
Expand All @@ -183,28 +186,16 @@ jobs:
- name: Cache targets
uses: actions/cache@v4
with:
key: ${{ runner.os }}-targets-20.x-ix--${{ hashFiles('package.json', 'yarn.lock', 'src/**/*') }}
key: ${{ join(fromJSON('["${{ runner.os }}", "targets", "20.x", "${{ matrix.target }}", "${{ matrix.module }}", "${{ hashFiles('package.json', 'yarn.lock', 'tsconfig.json', 'src/**/*', 'tsconfigs/**/*') }}"]'), '-') }}
path: targets

- name: Cache node_modules
uses: actions/cache@v4
with:
key: ${{ runner.os }}-node_modules-20.x-${{ hashFiles('package.json', 'yarn.lock') }}
key: ${{ join(fromJSON('["${{ runner.os }}", "node_modules", "20.x", "${{ hashFiles('package.json', 'yarn.lock') }"]', '-') }}
path: node_modules

- name: Check if source files changed
id: source_files_changed
uses: tj-actions/changed-files@v44
with:
files: |
.npmrc
yarn.lock
package.json
src/**/*
integration/**/*
- name: Test ${{ matrix.bundler }} tree-shaking
if: ${{ steps.source_files_changed.outputs.any_modified == 'true' }}
env:
t: "${{ matrix.target }}"
m: "${{ matrix.module }}"
Expand Down

0 comments on commit 21d9052

Please sign in to comment.