Skip to content

Commit f5da141

Browse files
authored
Merge pull request #2236 from Urigo/saihaj/more-shared-flows
ci: refactor to use guild composite actions
2 parents 1af2903 + a732ead commit f5da141

File tree

5 files changed

+26
-103
lines changed

5 files changed

+26
-103
lines changed

.github/workflows/algolia-integrity.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ jobs:
1313
fetch-depth: 0
1414
- name: Fetch
1515
run: git fetch origin master
16-
- name: Use Node 18
17-
uses: actions/setup-node@v3
16+
17+
- name: Setup env
18+
uses: the-guild-org/shared-config/setup@main
1819
with:
19-
node-version: 18
20-
cache: 'yarn'
21-
- name: Install Dependencies
22-
run: yarn --ignore-engines
20+
nodeVersion: 18
2321

2422
- name: Build Packages
2523
run: yarn build

.github/workflows/algolia-publish.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ jobs:
1313
- name: Checkout Repo
1414
uses: actions/checkout@v3
1515

16-
- name: Use Node
17-
uses: actions/setup-node@v3
16+
- name: Setup env
17+
uses: the-guild-org/shared-config/setup@main
1818
with:
19-
node-version: 18
20-
cache: 'yarn'
21-
22-
- name: Install Dependencies
23-
run: yarn
19+
nodeVersion: 18
2420

2521
- name: Build Packages
2622
run: yarn build

.github/workflows/benchmark.yml

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,7 @@ on: [push]
55
jobs:
66
Benchmark:
77
name: Benchmark on node ${{ matrix.node_version }}
8-
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
node_version: [16, 18]
12-
env:
13-
CI: true
14-
15-
steps:
16-
- uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Use Node.js ${{ matrix.node_version }}
21-
uses: actions/setup-node@master
22-
with:
23-
node-version: ${{ matrix.node_version }}
24-
25-
- uses: actions/cache@v2
26-
name: Cache node_modules
27-
with:
28-
path: '**/node_modules'
29-
key: ${{ runner.os }}-yarn-${{ matrix.node_version }}-16-${{ hashFiles('**/yarn.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-yarn-${{ matrix.node_version }}-16-
32-
${{ runner.os }}-yarn-${{ matrix.node_version }}-
33-
${{ runner.os }}-yarn-
34-
35-
- name: Install
36-
run: yarn --ignore-engines
37-
38-
- name: Build
39-
run: yarn build
40-
41-
- name: Benchmark
42-
run: 'yarn benchmark:basic'
8+
uses: the-guild-org/shared-config/.github/workflows/ci-node-matrix.yml@main
9+
with:
10+
script: 'yarn build && yarn benchmark:basic'
11+
nodeVersions: '[16,18]'

.github/workflows/tests.yml

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,11 @@ on:
99
jobs:
1010
lint:
1111
name: Lint
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout Master
15-
uses: actions/checkout@v3
16-
- name: Use Node
17-
uses: actions/setup-node@master
18-
with:
19-
node-version: 18
20-
- name: Cache Yarn
21-
uses: actions/cache@v2
22-
with:
23-
path: '**/node_modules'
24-
key: ${{ runner.os }}-18-16-yarn-${{ hashFiles('yarn.lock') }}
25-
restore-keys: |
26-
${{ runner.os }}-18-16-yarn
27-
- name: Install Dependencies using Yarn
28-
run: yarn install --ignore-engines && git checkout yarn.lock
29-
- name: Lint
30-
run: yarn lint
12+
uses: the-guild-org/shared-config/.github/workflows/lint.yml@main
13+
with:
14+
script: yarn ci:lint
15+
secrets:
16+
githubToken: ${{ secrets.GITHUB_TOKEN }}
3117
build:
3218
name: Type Check on GraphQL v${{matrix.graphql_version}}
3319
runs-on: ubuntu-latest
@@ -39,21 +25,12 @@ jobs:
3925
steps:
4026
- name: Checkout Master
4127
uses: actions/checkout@v3
42-
- name: Use Node
43-
uses: actions/setup-node@master
28+
- name: Setup env
29+
uses: the-guild-org/shared-config/setup@main
4430
with:
45-
node-version: 18
46-
- name: Cache Yarn
47-
uses: actions/cache@v2
48-
with:
49-
path: '**/node_modules'
50-
key: ${{ runner.os }}-18-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
51-
restore-keys: |
52-
${{ runner.os }}-18-${{matrix.graphql_version}}-yarn-
31+
nodeVersion: 18
5332
- name: Use GraphQL v${{matrix.graphql_version}}
5433
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
55-
- name: Install Dependencies using Yarn
56-
run: yarn install --ignore-engines && git checkout yarn.lock
5734
- name: Type Check
5835
run: yarn ts:check
5936
test:
@@ -69,21 +46,12 @@ jobs:
6946
steps:
7047
- name: Checkout Master
7148
uses: actions/checkout@v3
72-
- name: Use Node
73-
uses: actions/setup-node@master
74-
with:
75-
node-version: ${{ matrix.node-version }}
76-
- name: Cache Yarn
77-
uses: actions/cache@v2
49+
- name: Setup env
50+
uses: the-guild-org/shared-config/setup@main
7851
with:
79-
path: '**/node_modules'
80-
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
81-
restore-keys: |
82-
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-
52+
nodeVersion: 18
8353
- name: Use GraphQL v${{matrix.graphql_version}}
8454
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
85-
- name: Install Dependencies using Yarn
86-
run: yarn install --ignore-engines && git checkout yarn.lock
8755
- name: Cache Jest
8856
uses: actions/cache@v2
8957
with:
@@ -101,19 +69,10 @@ jobs:
10169
steps:
10270
- name: Checkout Master
10371
uses: actions/checkout@v3
104-
- name: Use Node
105-
uses: actions/setup-node@master
106-
with:
107-
node-version: 18
108-
- name: Cache Yarn
109-
uses: actions/cache@v2
72+
- name: Setup env
73+
uses: the-guild-org/shared-config/setup@main
11074
with:
111-
path: '**/node_modules'
112-
key: ${{ runner.os }}-18-16-yarn-${{ hashFiles('yarn.lock') }}
113-
restore-keys: |
114-
${{ runner.os }}-18-16-yarn-
115-
- name: Install Dependencies using Yarn
116-
run: yarn install --ignore-engines && git checkout yarn.lock
75+
nodeVersion: 18
11776
- name: Build Packages
11877
run: yarn build
11978
- name: Test ESM

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"prepare": "husky install",
1313
"postinstall": "patch-package",
1414
"ts:check": "tsc --project tsconfig.json --noEmit",
15+
"ci:lint": "eslint \"packages/**/*.{js,jsx,ts,tsx}\" --output-file eslint_report.json --format json",
1516
"build": "tsc --project tsconfig.json && bob build",
1617
"test": "jest",
1718
"prerelease": "yarn build",

0 commit comments

Comments
 (0)