Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9f6d565
Fix codegen tests
aryaemami59 Mar 27, 2024
61ab4ea
Fix minor typo in codegen CI
aryaemami59 Mar 27, 2024
1f8b9c5
Comment out code related to checking for changes in the codegen step
aryaemami59 Mar 27, 2024
8bd53a6
Refactor `afterEach` function in `cli.test.ts`
aryaemami59 Mar 27, 2024
3633760
Add `vite-tsconfig-paths` to `devDependencies`
aryaemami59 Mar 27, 2024
9f7c9f3
Use `vite-tsconfig-paths` for path aliases during tests
aryaemami59 Mar 27, 2024
8e5b246
Remove unnecessary aliases in `vitest.config.mts`
aryaemami59 Mar 27, 2024
5cb27c8
Update cli path in test file
aryaemami59 Mar 27, 2024
9f97693
Update `test-codegen.yml` with steps for building and testing artifacts
aryaemami59 Mar 27, 2024
d03ebbe
Add working directory for codegen in `test-codegen.yml`
aryaemami59 Mar 27, 2024
5e09295
Update artifact path in `test-codegen.yml`
aryaemami59 Mar 27, 2024
6c8573d
Fix install dependencies step in `test-codegen.yml`
aryaemami59 Mar 27, 2024
b1fbc96
Remove node 18 in `test-codegen.yml`
aryaemami59 Mar 27, 2024
44de8f0
Revert back to `yarn install`
aryaemami59 Mar 27, 2024
6ae0771
Only test on ubuntu for now
aryaemami59 Mar 27, 2024
fb8d5d1
Add `prepack` script to `package.json`
aryaemami59 Mar 27, 2024
474e6df
Import `generateEndpoints` from `@rtk-query/codegen-openapi`
aryaemami59 Mar 27, 2024
75d04d1
Remove unnecessary "prepare" script from `package.json`
aryaemami59 Mar 27, 2024
0ccfddc
Update artifact path in `test-codegen.yml`
aryaemami59 Mar 27, 2024
f3e4588
Add failure check in `test-codegen.yml`
aryaemami59 Mar 27, 2024
38b3e25
Update `cliPath` in `cli.test.ts`
aryaemami59 Mar 27, 2024
41059ec
Run CI for windows and macOS as well
aryaemami59 Mar 27, 2024
c5558c9
Try focused installs during CI
aryaemami59 Mar 27, 2024
1f72821
Remove unnecessary test setup in `cli.test.ts`
aryaemami59 Mar 27, 2024
4d1b465
Fix tests in `generateEndpoints.test.ts`
aryaemami59 Mar 27, 2024
aac1744
Update snapshots for `generateEndpoints.test.ts.snap`
aryaemami59 Mar 27, 2024
9a216c4
Move path aliases from the root `tsconfig.json` to `test/tsconfig.json`
aryaemami59 Mar 27, 2024
9d54002
Update `cliPath` in `cli.test.ts`
aryaemami59 Mar 27, 2024
f94bcf1
Sort fields in `test/tsconfig.json` of codegen
aryaemami59 Mar 27, 2024
cb82bba
Make `test\tsconfig.json` extend the root `tsconfig.json`
aryaemami59 Mar 27, 2024
4304e09
Rename `tsconfig.json` to `tsconfig.build.json`
aryaemami59 Mar 27, 2024
53e6434
Rename `test/tsconfig.json` to `tsconfig.json`
aryaemami59 Mar 27, 2024
55e0ae6
Make `tsconfig.build.json` extend `tsconfig.json`
aryaemami59 Mar 27, 2024
5516913
Update path alias in `tsconfig.json`
aryaemami59 Mar 27, 2024
c9ba5a8
Uncomment commented out code in `test-codegen.yml`
aryaemami59 Mar 27, 2024
5db8720
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Apr 2, 2024
d5af58c
Run CI build step only once
aryaemami59 Apr 2, 2024
e12961d
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Apr 5, 2024
25fbf9a
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Apr 12, 2024
da9f632
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Apr 16, 2024
9168e00
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Apr 17, 2024
fdcb9f4
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 1, 2024
5002ad4
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 1, 2024
062fbf1
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 2, 2024
1d2a8eb
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 6, 2024
f17efa4
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 7, 2024
8006fae
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 9, 2024
bf2dbe8
Merge branch 'fix-codegen-tests' of https://github.com/aryaemami59/re…
aryaemami59 May 9, 2024
00ee6a4
Merge branch 'fix-codegen-tests' of https://github.com/aryaemami59/re…
aryaemami59 May 14, 2024
b6fe0c4
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 16, 2024
7ddf1a2
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 16, 2024
023ffab
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 May 25, 2024
68603c1
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jun 3, 2024
b45e23f
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jun 4, 2024
09aebb9
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jun 19, 2024
3c6a954
Change `module` to `ESNext`
aryaemami59 Jun 19, 2024
25b64f8
Update snapshots
aryaemami59 Jun 19, 2024
5a046b0
Install dependencies correctly during CI
aryaemami59 Jun 19, 2024
f82e2f9
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jun 21, 2024
bac73f1
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jun 28, 2024
78c767f
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jul 9, 2024
f11172c
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jul 30, 2024
01963df
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Aug 10, 2024
ae438a5
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Aug 13, 2024
ff4b0e7
Remove `tslib` related settings
aryaemami59 Aug 27, 2024
307b537
Remove unnecessary `module` in `tsconfig.build.json`
aryaemami59 Aug 27, 2024
beefce5
Add `rootDir`
aryaemami59 Aug 27, 2024
b593d6a
Fix `paths` in `tsconfig.json`
aryaemami59 Aug 27, 2024
5167996
Fix cli path
aryaemami59 Jul 10, 2024
1c810d3
Fix unit tests in `cli.test.ts`
aryaemami59 Aug 27, 2024
6e597d2
Fix unit tests in `generateEndpoints.test.ts`
aryaemami59 Aug 27, 2024
88f367f
Run type checker with `vitest`
aryaemami59 Jul 10, 2024
37cf864
Bump Vitest to version 2.0.5
aryaemami59 Aug 27, 2024
54edaf0
Bump `vite-tsconfig-paths` to version 5.0.1
aryaemami59 Aug 27, 2024
265cda3
Bump `esbuild` to version 0.23.1
aryaemami59 Aug 27, 2024
1343cf1
Add `@oazapfts/runtime` to satisfy peer dependency requirements
aryaemami59 Aug 27, 2024
05d1d71
Fix minor TS-related issue in `generateEndpoints.test.ts`
aryaemami59 Aug 27, 2024
0f1b03f
Run CI if `.github/workflows/test-codegen.yml` changes
aryaemami59 Aug 27, 2024
00ae2ea
Fix `tsconfig.build.json`
aryaemami59 Aug 27, 2024
7d63668
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Aug 29, 2024
829d16f
Only run codegen tests on Linux
markerikson Aug 30, 2024
91aea9a
Shorten task names for readability
markerikson Aug 30, 2024
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
84 changes: 77 additions & 7 deletions .github/workflows/test-codegen.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: RTK-Query OpenAPI Codegen Tests
name: RTKQ OpenAPI Codegen
defaults:
run:
working-directory: ./packages/rtk-query-codegen-openapi
Expand All @@ -23,24 +23,94 @@ jobs:
codegen:
- 'packages/rtk-query-codegen-openapi/**'
- 'yarn.lock'
- '.github/workflows/test-codegen.yml'

build:
needs: changes
if: ${{ needs.changes.outputs.codegen == 'true' }}

runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/rtk-query-codegen-openapi

runs-on: ${{ matrix.os }}

name: Build artifact for ${{ matrix.os }} with Node ${{ matrix.node-version }}

strategy:
matrix:
node-version: ['20.x']
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- run: yarn install
- run: yarn test
- name: Install dependencies
run: yarn install

- name: Pack
run: yarn pack

- name: Upload artifact
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: package
path: ./packages/rtk-query-codegen-openapi/package.tgz

- name: Did we fail?
if: failure()
run: ls -R

test:
needs: build
defaults:
run:
working-directory: ./packages/rtk-query-codegen-openapi
name: Test final build artifact with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [20.x]
os: [ubuntu-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Download artifact
id: download-artifact
uses: actions/download-artifact@v4
with:
path: ./packages/rtk-query-codegen-openapi
name: package

- name: Install dependencies
run: yarn install

- name: Install build artifact
run: yarn add ./package.tgz

- name: Remove path alias
run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.json

- name: Run tests
run: yarn test

- name: Did we fail?
if: failure()
run: ls -R
12 changes: 7 additions & 5 deletions packages/rtk-query-codegen-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"rtk-query-codegen-openapi": "lib/bin/cli.js"
},
"scripts": {
"build": "yarn clean && tsc && chmod +x lib/bin/cli.js",
"build": "yarn clean && tsc -p tsconfig.build.json && chmod +x lib/bin/cli.js",
"clean": "rimraf lib",
"prepare": "yarn build && chmod +x lib/bin/cli.js",
"prepack": "yarn build",
"format": "prettier --write \"src/**/*.ts\"",
"test:update": "vitest --run --update",
"test:update:enum": "lib/bin/cli.js test/config.example.enum.ts",
"test": "vitest --run",
"test": "vitest --run --typecheck",
"test:watch": "vitest --watch",
"cli": "esr src/bin/cli.ts"
},
Expand All @@ -35,6 +35,7 @@
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-typescript": "^7.12.7",
"@oazapfts/runtime": "^1.0.3",
"@reduxjs/toolkit": "^1.6.0",
"@types/commander": "^2.12.2",
"@types/glob-to-regexp": "^0.4.0",
Expand All @@ -43,7 +44,7 @@
"@types/semver": "^7.3.9",
"chalk": "^4.1.0",
"del": "^6.0.0",
"esbuild": "~0.17",
"esbuild": "^0.23.1",
"esbuild-runner": "^2.2.1",
"husky": "^4.3.6",
"msw": "^2.1.5",
Expand All @@ -52,7 +53,8 @@
"pretty-quick": "^4.0.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"vitest": "^1.6.0",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.0.5",
"yalc": "^1.0.0-pre.47"
},
"dependencies": {
Expand Down
Loading