Skip to content

Commit

Permalink
Merge pull request #2236 from Urigo/saihaj/more-shared-flows
Browse files Browse the repository at this point in the history
ci: refactor to use guild composite actions
  • Loading branch information
saihaj committed Aug 19, 2022
2 parents 1af2903 + a732ead commit f5da141
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 103 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/algolia-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ jobs:
fetch-depth: 0
- name: Fetch
run: git fetch origin master
- name: Use Node 18
uses: actions/setup-node@v3

- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
node-version: 18
cache: 'yarn'
- name: Install Dependencies
run: yarn --ignore-engines
nodeVersion: 18

- name: Build Packages
run: yarn build
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/algolia-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Use Node
uses: actions/setup-node@v3
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
node-version: 18
cache: 'yarn'

- name: Install Dependencies
run: yarn
nodeVersion: 18

- name: Build Packages
run: yarn build
Expand Down
39 changes: 4 additions & 35 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,7 @@ on: [push]
jobs:
Benchmark:
name: Benchmark on node ${{ matrix.node_version }}
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [16, 18]
env:
CI: true

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}

- uses: actions/cache@v2
name: Cache node_modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ matrix.node_version }}-16-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node_version }}-16-
${{ runner.os }}-yarn-${{ matrix.node_version }}-
${{ runner.os }}-yarn-
- name: Install
run: yarn --ignore-engines

- name: Build
run: yarn build

- name: Benchmark
run: 'yarn benchmark:basic'
uses: the-guild-org/shared-config/.github/workflows/ci-node-matrix.yml@main
with:
script: 'yarn build && yarn benchmark:basic'
nodeVersions: '[16,18]'
69 changes: 14 additions & 55 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,11 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@master
with:
node-version: 18
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-18-16-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-18-16-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Lint
run: yarn lint
uses: the-guild-org/shared-config/.github/workflows/lint.yml@main
with:
script: yarn ci:lint
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
build:
name: Type Check on GraphQL v${{matrix.graphql_version}}
runs-on: ubuntu-latest
Expand All @@ -39,21 +25,12 @@ jobs:
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@master
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
node-version: 18
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-18-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-18-${{matrix.graphql_version}}-yarn-
nodeVersion: 18
- name: Use GraphQL v${{matrix.graphql_version}}
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Type Check
run: yarn ts:check
test:
Expand All @@ -69,21 +46,12 @@ jobs:
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node-version }}
- name: Cache Yarn
uses: actions/cache@v2
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-
nodeVersion: 18
- name: Use GraphQL v${{matrix.graphql_version}}
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Cache Jest
uses: actions/cache@v2
with:
Expand All @@ -101,19 +69,10 @@ jobs:
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@master
with:
node-version: 18
- name: Cache Yarn
uses: actions/cache@v2
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
path: '**/node_modules'
key: ${{ runner.os }}-18-16-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-18-16-yarn-
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
nodeVersion: 18
- name: Build Packages
run: yarn build
- name: Test ESM
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"prepare": "husky install",
"postinstall": "patch-package",
"ts:check": "tsc --project tsconfig.json --noEmit",
"ci:lint": "eslint \"packages/**/*.{js,jsx,ts,tsx}\" --output-file eslint_report.json --format json",
"build": "tsc --project tsconfig.json && bob build",
"test": "jest",
"prerelease": "yarn build",
Expand Down

1 comment on commit f5da141

@vercel
Copy link

@vercel vercel bot commented on f5da141 Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.