-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify Github Actions configuration by extracting common steps into…
… a composite action See https://github.com/prezly/setup-github-actions
- Loading branch information
Showing
5 changed files
with
161 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,39 @@ | ||
name: Build | ||
|
||
on: [push] | ||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
react-version: [16.14.0, 17, 18] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 8.4.0 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Set React ${{ matrix.react-version }} | ||
uses: jossef/action-set-json-field@v2.1 | ||
with: | ||
file: package.json | ||
parse_json: true | ||
field: pnpm.overrides | ||
value: '{"@types/react":"${{ env.REACT_TYPES_VERSION }}","@types/react-dom":"${{ env.REACT_DOM_TYPES_VERSION }}","react":"${{ env.REACT_VERSION }}","react-dom":"${{ env.REACT_DOM_VERSION }}"}' | ||
env: | ||
REACT_TYPES_VERSION: ${{ matrix.react-version }} | ||
REACT_VERSION: ${{ matrix.react-version }} | ||
REACT_DOM_TYPES_VERSION: ${{ startsWith(matrix.react-version, '16.') && '16.9.9' || matrix.react-version }} | ||
REACT_DOM_VERSION: ${{ matrix.react-version }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- run: pnpm build | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [ 16.x ] | ||
react-version: [ 16.14.0, 17, 18 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Environment | ||
uses: prezly/setup-github-actions@v1 | ||
with: | ||
node: ${{ matrix.node-version }} | ||
pnpm: "8.4.0" | ||
|
||
- name: Set React ${{ matrix.react-version }} | ||
uses: jossef/action-set-json-field@v2.1 | ||
with: | ||
file: package.json | ||
parse_json: true | ||
field: pnpm.overrides | ||
value: '{"@types/react":"${{ env.REACT_TYPES_VERSION }}","@types/react-dom":"${{ env.REACT_DOM_TYPES_VERSION }}","react":"${{ env.REACT_VERSION }}","react-dom":"${{ env.REACT_DOM_VERSION }}"}' | ||
env: | ||
REACT_TYPES_VERSION: ${{ matrix.react-version }} | ||
REACT_VERSION: ${{ matrix.react-version }} | ||
REACT_DOM_TYPES_VERSION: ${{ startsWith(matrix.react-version, '16.') && '16.9.9' || matrix.react-version }} | ||
REACT_DOM_VERSION: ${{ matrix.react-version }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- run: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,37 @@ | ||
name: Dependencies Alignment | ||
|
||
on: [push] | ||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
react-version: [16.14.0, 17, 18] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 8.4.0 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Set React ${{ matrix.react-version }} | ||
uses: jossef/action-set-json-field@v2.1 | ||
with: | ||
file: package.json | ||
parse_json: true | ||
field: pnpm.overrides | ||
value: '{"@types/react":"${{ env.REACT_TYPES_VERSION }}","@types/react-dom":"${{ env.REACT_DOM_TYPES_VERSION }}","react":"${{ env.REACT_VERSION }}","react-dom":"${{ env.REACT_DOM_VERSION }}"}' | ||
env: | ||
REACT_TYPES_VERSION: ${{ matrix.react-version }} | ||
REACT_VERSION: ${{ matrix.react-version }} | ||
REACT_DOM_TYPES_VERSION: ${{ startsWith(matrix.react-version, '16.') && '16.9.9' || matrix.react-version }} | ||
REACT_DOM_VERSION: ${{ matrix.react-version }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install --no-frozen-lockfile --strict-peer-dependencies --ignore-pnpmfile --prod | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [ 16.x ] | ||
react-version: [ 16.14.0, 17, 18 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Environment | ||
uses: prezly/setup-github-actions@v1 | ||
with: | ||
node: ${{ matrix.node-version }} | ||
pnpm: "8.4.0" | ||
|
||
- name: Set React ${{ matrix.react-version }} | ||
uses: jossef/action-set-json-field@v2.1 | ||
with: | ||
file: package.json | ||
parse_json: true | ||
field: pnpm.overrides | ||
value: '{"@types/react":"${{ env.REACT_TYPES_VERSION }}","@types/react-dom":"${{ env.REACT_DOM_TYPES_VERSION }}","react":"${{ env.REACT_VERSION }}","react-dom":"${{ env.REACT_DOM_VERSION }}"}' | ||
env: | ||
REACT_TYPES_VERSION: ${{ matrix.react-version }} | ||
REACT_VERSION: ${{ matrix.react-version }} | ||
REACT_DOM_TYPES_VERSION: ${{ startsWith(matrix.react-version, '16.') && '16.9.9' || matrix.react-version }} | ||
REACT_DOM_VERSION: ${{ matrix.react-version }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install --no-frozen-lockfile --strict-peer-dependencies --ignore-pnpmfile --prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,25 @@ | ||
name: Prettier | ||
|
||
on: [push] | ||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
strategy: | ||
matrix: | ||
node-version: [ 16.x ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Setup Environment | ||
uses: prezly/setup-github-actions@v1 | ||
with: | ||
node: ${{ matrix.node-version }} | ||
pnpm: "8.4.0" | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 8.4.0 | ||
run_install: false | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- run: pnpm prettier | ||
- run: pnpm prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,44 @@ | ||
name: Build Storybook | ||
|
||
on: [push] | ||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
react-version: [16.14.0, 17, 18] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 8.4.0 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Set React ${{ matrix.react-version }} | ||
uses: jossef/action-set-json-field@v2.1 | ||
with: | ||
file: package.json | ||
parse_json: true | ||
field: pnpm.overrides | ||
value: '{"@types/react":"${{ env.REACT_TYPES_VERSION }}","@types/react-dom":"${{ env.REACT_DOM_TYPES_VERSION }}","react":"${{ env.REACT_VERSION }}","react-dom":"${{ env.REACT_DOM_VERSION }}"}' | ||
env: | ||
REACT_TYPES_VERSION: ${{ matrix.react-version }} | ||
REACT_VERSION: ${{ matrix.react-version }} | ||
REACT_DOM_TYPES_VERSION: ${{ startsWith(matrix.react-version, '16.') && '16.9.9' || matrix.react-version }} | ||
REACT_DOM_VERSION: ${{ matrix.react-version }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- name: Build Project | ||
run: pnpm build | ||
|
||
- name: Build Storybook | ||
run: pnpm storybook:build | ||
working-directory: packages/slate-editor | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [ 16.x ] | ||
react-version: [ 16.14.0, 17, 18 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Environment | ||
uses: prezly/setup-github-actions@v1 | ||
with: | ||
node: ${{ matrix.node-version }} | ||
pnpm: "8.4.0" | ||
|
||
- name: Set React ${{ matrix.react-version }} | ||
uses: jossef/action-set-json-field@v2.1 | ||
with: | ||
file: package.json | ||
parse_json: true | ||
field: pnpm.overrides | ||
value: '{"@types/react":"${{ env.REACT_TYPES_VERSION }}","@types/react-dom":"${{ env.REACT_DOM_TYPES_VERSION }}","react":"${{ env.REACT_VERSION }}","react-dom":"${{ env.REACT_DOM_VERSION }}"}' | ||
env: | ||
REACT_TYPES_VERSION: ${{ matrix.react-version }} | ||
REACT_VERSION: ${{ matrix.react-version }} | ||
REACT_DOM_TYPES_VERSION: ${{ startsWith(matrix.react-version, '16.') && '16.9.9' || matrix.react-version }} | ||
REACT_DOM_VERSION: ${{ matrix.react-version }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- name: Build Project | ||
run: pnpm build | ||
|
||
- name: Build Storybook | ||
run: pnpm storybook:build | ||
working-directory: packages/slate-editor |
Oops, something went wrong.