Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize CI workflows #633

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/build.yml

This file was deleted.

144 changes: 144 additions & 0 deletions .github/workflows/js-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: JS SDK

on:
push:
branches:
- main

pull_request:
paths:
Copy link
Contributor

Choose a reason for hiding this comment

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

Did not know this option was a thing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'm using this for the node bindings in libxmtp as well. i have some more optimizations in mind for libxmtp to help speed up the workflows using paths.

- 'packages/js-sdk/**'
- '.github/workflows/js-sdk.yml'
- '.node-version'
- '.nvmrc'
- '.prettierignore'
- '.prettierrc.cjs'

jobs:
typecheck:
name: Typecheck
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- name: Typecheck
run: |
cd packages/js-sdk
yarn typecheck

lint:
name: Lint
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- name: Lint
run: |
cd packages/js-sdk
yarn lint

prettier:
name: Prettier
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- name: Format check
run: |
cd packages/js-sdk
yarn format:check

node:
name: Test node
# TODO: Investigate why fetch is failing for some of these tests on warp build runners
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- run: ./dev/up
- run: |
cd packages/js-sdk
yarn test:node
env:
NODE_OPTIONS: '-r dd-trace/ci/init'
DD_ENV: ci:node
DD_SERVICE: xmtp-js
DD_CIVISIBILITY_AGENTLESS_ENABLED: 'true'
DD_API_KEY: ${{ secrets.DD_API_KEY }}

browser:
name: Test browser
# TODO: Investigate why fetch is failing for some of these tests on warp build runners
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- run: ./dev/up
- run: |
cd packages/js-sdk
yarn test:browser

build:
name: Build
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- name: Build
run: |
cd packages/js-sdk
yarn build
49 changes: 42 additions & 7 deletions .github/workflows/lint.yml → .github/workflows/mls-client.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
name: Code checks
name: MLS Client

on:
push:
branches:
- main

pull_request:
paths:
- 'packages/mls-client/**'
- '.github/workflows/mls-client.yml'
- '.node-version'
- '.nvmrc'
- '.prettierignore'
- '.prettierrc.cjs'

jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -22,11 +31,13 @@ jobs:
- name: Install dependencies
run: yarn
- name: Typecheck
run: yarn typecheck
run: |
cd packages/mls-client
yarn typecheck

lint:
name: Lint
runs-on: ubuntu-latest
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -40,11 +51,13 @@ jobs:
- name: Install dependencies
run: yarn
- name: Lint
run: yarn lint
run: |
cd packages/mls-client
yarn lint

prettier:
name: Prettier
runs-on: ubuntu-latest
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -58,4 +71,26 @@ jobs:
- name: Install dependencies
run: yarn
- name: Format check
run: yarn format:check
run: |
cd packages/mls-client
yarn format:check

build:
name: Build
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- name: Build
run: |
cd packages/mls-client
yarn build
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Release

on:
push:
branches:
- main
- releases/beta
- releases/**

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/test.yml

This file was deleted.

Loading