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

chore: update github actions to only run integration tests on affected projects #87

Merged
merged 3 commits into from
Aug 17, 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
10 changes: 7 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install Node Dependencies
run: pnpm i -r --frozen-lockfile
- name: Set NX Shas
uses: nrwl/nx-set-shas@v3
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: master
- run: pnpm nx affected -t pub -- get # install dart dependencies for affected projects
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Install Node Dependencies
run: pnpm i -r --frozen-lockfile
- name: Set NX Shas
uses: nrwl/nx-set-shas@v3
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: master
- run: pnpm nx affected -t pub -- get # install dart dependencies for affected projects
Expand Down Expand Up @@ -110,8 +110,12 @@ jobs:
cache: pnpm
- name: Install Node Dependencies
run: pnpm i -r --frozen-lockfile
- name: Set NX Shas
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: master
- name: Install dart dependencies
run: pnpm nx run-many -t pub -- get # install dart dependencies in all dart projects
- run: pnpm run build
- run: pnpm i -r
- run: pnpm run integration-tests
- run: pnpm run integration-tests:affected
14 changes: 10 additions & 4 deletions languages/dart/dart-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"version": "0.60.1",
"type": "module",
"license": "MIT",
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -13,10 +18,11 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"files": [
"dist"
],
"dependencies": {
"@arrirpc/codegen-utils": "workspace:*",
"@arrirpc/schema": "workspace:*",
"pathe": "^1.1.2"
}
}
17 changes: 11 additions & 6 deletions languages/kotlin/kotlin-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"version": "0.60.1",
"type": "module",
"license": "MIT",
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -13,10 +18,10 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"files": [
"dist"
],
"dependencies": {
"@arrirpc/codegen-utils": "workspace:*",
"@arrirpc/schema": "workspace:*",
"json-schema-to-jtd": "workspace:*"
"@arrirpc/codegen-utils": "workspace:*"
}
}
15 changes: 11 additions & 4 deletions languages/rust/rust-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
"name": "@arrirpc/codegen-rust",
"type": "module",
"license": "MIT",
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -12,11 +17,13 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"files": [
"dist"
],
"dependencies": {
"@arrirpc/codegen-utils": "workspace:*",
"pathe": "^1.1.2"
},
"devDependencies": { "@arrirpc/schema": "workspace:*" },
"devDependencies": {},
"version": "0.60.1"
}
17 changes: 13 additions & 4 deletions languages/swift/swift-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"version": "0.60.1",
"type": "module",
"license": "MIT",
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -13,7 +18,11 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"dependencies": { "@arrirpc/codegen-utils": "workspace:*" },
"files": [
"dist"
],
"dependencies": {
"@arrirpc/codegen-utils": "workspace:*"
},
"devDependencies": {}
}
16 changes: 11 additions & 5 deletions languages/ts/ts-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"version": "0.60.1",
"type": "module",
"license": "MIT",
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -13,11 +18,12 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"files": [
"dist"
],
"dependencies": {
"@arrirpc/codegen-utils": "workspace:*",
"@arrirpc/schema": "workspace:*",
"prettier": "^3.3.3"
},
"devDependencies": { "@arrirpc/client": "workspace:*" }
"devDependencies": {}
}
2 changes: 0 additions & 2 deletions languages/ts/ts-codegen/src/_index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO

import { AppDefinition, normalizeWhitespace } from "@arrirpc/codegen-utils";
import fs from "fs";
import path from "path";
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"integration-tests": "start-server-and-test 'integration-tests:start-server' http-get://127.0.0.1:2020/status 'integration-tests:run-tests'",
"integration-tests:start-server": "nx build-server test-server && node tests/server/.output/server.mjs --host",
"integration-tests:run-tests": "nx run-many -t integration-test --parallel=false",
"integration-tests:affected": "start-server-and-test 'integration-tests:start-server' http-get://127.0.0.1:2020/status 'integration-tests:affected:run-tests'",
"integration-tests:affected:run-tests": "nx affected -t integration-test --parallel=false",
"scaffold": "jiti internal/scripts/scaffold-package.ts",
"postversion": "jiti internal/scripts/version-sync.ts",
"gen-test-utils": "jiti internal/scripts/generate-test-utils.ts",
Expand Down
23 changes: 0 additions & 23 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion tests/clients/dart/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test-client-dart",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": ["dart-client", "test-server"],
"implicitDependencies": ["dart-client", "dart-codegen"],
"targets": {
"pub": {
"executor": "nx:run-commands",
Expand Down
2 changes: 1 addition & 1 deletion tests/clients/kotlin/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test-client-kotlin",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": ["test-server"],
"implicitDependencies": ["kotlin-codegen"],
"targets": {
"integration-test": {
"executor": "nx:run-commands",
Expand Down
2 changes: 1 addition & 1 deletion tests/clients/rust/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test-client-rust",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": ["test-server", "rust-client"],
"implicitDependencies": ["rust-codegen", "rust-client"],
"targets": {
"integration-test": {
"executor": "nx:run-commands",
Expand Down
2 changes: 1 addition & 1 deletion tests/clients/swift/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test-client-swift",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": ["test-server", "swift-client"],
"implicitDependencies": ["swift-codegen", "swift-client"],
"targets": {
"integration-test": {
"executor": "nx:run-commands",
Expand Down
2 changes: 1 addition & 1 deletion tests/clients/ts/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test-client-ts",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": ["test-server", "ts-client"],
"implicitDependencies": ["ts-codegen", "ts-client"],
"targets": {
"integration-test": {
"executor": "@nx/vite:test",
Expand Down
2 changes: 1 addition & 1 deletion tooling/codegen-utils/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
entries: ["./src/index", "./src/testModels.ts"],
entries: ["./src/index"],
rollup: {
emitCJS: true,
dts: {
Expand Down
17 changes: 12 additions & 5 deletions tooling/codegen-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
"name": "@arrirpc/codegen-utils",
"version": "0.60.1",
"license": "MIT",
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -13,10 +18,12 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"files": [
"dist"
],
"dependencies": {
"@arrirpc/schema": "workspace:*",
"jtd-utils": "workspace:*",
"scule": "^1.3.0"
}
},
"devDependencies": {}
}
3 changes: 1 addition & 2 deletions tooling/codegen-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const isHttpMethod = (input: any): input is HttpMethod => {
if (typeof input !== "string") {
return false;
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return HttpMethodValues.includes(input as any);
};

Expand Down Expand Up @@ -147,7 +146,7 @@ export function isServiceDefinition(input: any): input is ServiceDefinition {
if (typeof input !== "object") {
return false;
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument

for (const key of Object.keys(input)) {
if (typeof input[key] !== "object") {
return false;
Expand Down
Loading
Loading