Skip to content

Commit

Permalink
chore: migrate to github workflows (#2327)
Browse files Browse the repository at this point in the history
* migrate to github workflows

* upgrade mrlint

* fix fern version

* always run all tests

* fix jest.config.ts compile

* fix reference to fhir dir in test

* update snapshots

* try again

* fix publish circle job dependencies

* run yarn test with FERN_TOKEN
  • Loading branch information
dsinghvi authored Nov 24, 2023
1 parent 2f74966 commit 295e5e1
Show file tree
Hide file tree
Showing 381 changed files with 899 additions and 356 deletions.
173 changes: 0 additions & 173 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,106 +2,6 @@ version: 2.1
orbs:
node: circleci/[email protected]
jobs:
check:
docker:
- image: cimg/node:18.8.0
resource_class: large
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: lint:monorepo
command: yarn lint:monorepo
- run:
name: Check root package
command: yarn root-package:check
- run:
name: Check dependencies
command: yarn depcheck
- run:
name: lint:style
command: yarn lint:style
- run:
name: fern check
command: npx fern-api check
- run:
name: fern check test definitons
command: |
yarn workspace @fern-api/cli dist:cli:dev
cd test-definitions
node $(yarn workspace @fern-api/cli bin fern:dev) check
- run:
name: generate (dev) JSON Schema
command: yarn generate-json-schema:dev
- run:
name: Format
command: yarn format:check
- run:
name: Ensure no changes to git-tracked files
command: git --no-pager diff --exit-code

eslint:
docker:
- image: cimg/node:18.8.0
resource_class: large
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
# compilation is needed for some typescript-eslint rules
name: compile
command: yarn compile
- run:
name: lint:eslint
command: yarn lint:eslint

compile:
docker:
- image: cimg/node:18.8.0
resource_class: large
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: compile
command: yarn compile

test:
# this is machine because of the docker-utils tests
machine:
image: ubuntu-2004:current
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: Run tests
command: yarn test --ci
- run:
name: Ensure no changes to git-tracked files
command: git --no-pager diff --exit-code

ete-tests:
# this is machine because of the local generation tests
machine:
image: ubuntu-2004:current
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: Run ETE tests
command: |
echo 'export FERN_TOKEN="$FERN_ORG_TOKEN_DEV"' >> $BASH_ENV
source "$BASH_ENV"
yarn test:ete
- run:
name: Ensure no changes to git-tracked files
command: git --no-pager diff --exit-code

live-test-dev:
docker:
- image: cimg/node:18.8.0
Expand Down Expand Up @@ -242,54 +142,10 @@ jobs:
export FERN_TOKEN="$FERN_ORG_TOKEN_PROD"
npx fern-api generate --api ir-types-v31 --group sdks
check-cli-release-is-allowed:
docker:
- image: cimg/node:18.8.0
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: Check release blockers
command: yarn check-cli-release-blockers
- run:
name: Ensure JSON schema is up to date
command: |
yarn generate-json-schema
git --no-pager diff --exit-code
workflows:
version: 2
build:
jobs:
- check:
filters:
tags:
only: /.*/

- eslint:
filters:
tags:
only: /.*/

- compile:
filters:
tags:
only: /.*/

- test:
filters:
tags:
only: /.*/

- ete-tests:
filters:
tags:
only: /.*/
context:
- auth0-dev
- fern-tokens

- live-test-dev:
filters:
tags:
Expand All @@ -313,12 +169,6 @@ workflows:
filters:
branches:
only: main
requires:
- check
- compile
- eslint
- test
- ete-tests
context:
- npm
- auth0-dev
Expand All @@ -330,11 +180,6 @@ workflows:
tags:
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)-rc([0-9]+)$/
requires:
- check
- compile
- eslint
- test
- ete-tests
- live-test-dev
context:
- npm
Expand All @@ -348,12 +193,6 @@ workflows:
tags:
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)$/
requires:
- check-cli-release-is-allowed
- check
- compile
- eslint
- test
- ete-tests
- live-test-dev
- live-test
context:
Expand All @@ -368,18 +207,6 @@ workflows:
tags:
only: /.*/
requires:
- check
- compile
- eslint
- test
- ete-tests
- live-test-dev
context:
- fern-tokens

- check-cli-release-is-allowed:
filters:
branches:
ignore: /.*/
tags:
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)$/
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: ci
on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Install
run: yarn install

- name: Lint Monorepo
run: yarn lint:monorepo

- name: Check dependencies
run: yarn depcheck

- name: Lint
run: yarn lint:style

- name: generate (dev) JSON Schema
run: yarn generate-json-schema:dev

- name: Format
run: yarn format:check

- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

compile:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Install
run: yarn install

- name: compile
run: yarn compile

- name: lint:eslint
run: yarn lint:eslint

test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Install
run: yarn install

- name: Run tests
run: yarn test --ci

- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

ete-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Install
run: yarn install

- name: Run ETE tests
env:
FERN_ORG_TOKEN_DEV: ${{ secrets.FERN_ORG_TOKEN_DEV }}
run: |
FERN_TOKEN=${{ secrets.FERN_ORG_TOKEN_DEV }} yarn test:ete
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: test-definitions

on:
pull_request:
branches:
- main
name: fern
on: [push]

jobs:
fern-check:
check-ir-definitions:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Fern
run: npm install -g fern-api

- name: Check Fern API is valid
run: fern check

check-test-definitions:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand Down
10 changes: 5 additions & 5 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ groups:
output:
location: npm
url: npm.buildwithfern.com
package-name: "@fern-fern/docs-config"
package-name: '@fern-fern/docs-config'
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fern/fhir/generators.yml → fern/apis/fhir/generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ groups:
output:
location: npm
url: npm.buildwithfern.com
package-name: "@fern-fern/fhir-model"
package-name: '@fern-fern/fhir-model'
config:
useBrandedStringAliases: true
noSerdeLayer: true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ groups:
- name: fernapi/fern-pydantic-model
version: 0.0.33-5-g3540939
config:
wrapped_aliases: True
wrapped_aliases: true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 295e5e1

Please sign in to comment.