feat(codegen): commit generated client types to codebase (#3492)

## What

Commit generated client types to codebase.

## Why

As a developer, we will provides better visibility on the impact of OAS changes to the generated type. Also allow for browser the types on GitHub.

## How

* Remove `/lib` from .gitignore
* Add a non-blocking github action check validating if the latest generated build has been committed.
  * Runs `yarn build --force --no-cache` on GitHub. Caching was creating false positives.
  * Use `git status` and filter the output to target only `packages/generated` directory. 

## Test

Proof of a failing check:
https://github.com/medusajs/medusa/actions/runs/4432323763/jobs/7776235128

UPDATE: Failing check after updating branch with latest develop
https://github.com/medusajs/medusa/actions/runs/4436707954/jobs/7785472045
This commit is contained in:
Patrick
2023-03-16 11:30:40 -04:00
committed by GitHub
parent 7e17e0ddc2
commit e6e5291527
475 changed files with 17206 additions and 2 deletions

40
.github/workflows/codegen-test.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: OAS Codegen Build Check - BETA
on:
pull_request:
paths-ignore:
- "docs/**"
- "www/**"
jobs:
codegen-test:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2.3.5
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.1
with:
node-version: "14"
cache: "yarn"
- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: codegen
- name: Build Packages - Force
run: yarn build --force --no-cache
- name: Assert latest codegen build committed
run: ./scripts/assert-codegen-build-committed-actions.sh