Skip to content

Commit

Permalink
chore: remove gts, eslint, integration tests, fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster committed Feb 1, 2023
1 parent 3087021 commit a41dad5
Show file tree
Hide file tree
Showing 29 changed files with 68 additions and 2,955 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

46 changes: 4 additions & 42 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ jobs:
chmod +x bazel-bin/protoc_plugin.sh
./gapic-error-conformance -plugin="bazel-bin/protoc_plugin.sh"
- name: Run linting
run: bazel run @nodejs//:npm -- run lint

- name: Prepare baseline artifacts
run: |
mkdir -p ~/artifacts/test-application-runners
tar cfz ~/artifacts/test-protos.tar.gz -C test-fixtures protos
cp bazel-bin/typescript/test/test-application/test-*.js ~/artifacts/test-application-runners/
mkdir -p ~/artifacts
cp bazel-testlogs/unit_tests/test.outputs/outputs.zip ~/artifacts/
bazel run -- @pnpm//:pnpm --dir $PWD install
tar cfz ~/artifacts/node_modules.tar.gz node_modules
- name: Save artifacts
Expand All @@ -72,42 +68,6 @@ jobs:
name: artifacts
path: ~/artifacts

showcase-test-application:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# Test on the oldest and the newest supported version just in case
node-version: [12.x, 14.x, 16.x]
test: [js, ts]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
path: ~/artifacts

- name: Prepare test applications
run: |
rm -f bazel-testlogs
mkdir -p bazel-testlogs/unit_tests/test.outputs
mv ~/artifacts/outputs.zip bazel-testlogs/unit_tests/test.outputs/
tar xzf ~/artifacts/node_modules.tar.gz
mv ~/artifacts/test-application-runners/test-${{ matrix.test }}.js .
- name: Run ${{ matrix.test }} test application
run: npx mocha test-${{ matrix.test }}.js
env:
NPM_CONFIG_PREFIX: /tmp/.npm-global

lib-tests:
needs: build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -139,6 +99,8 @@ jobs:
npm install
npm test
npm run fix
# Second compile to make sure "gts fix" did not break the code, it happens!
rm -rf build
npm run compile
npm run system-test
npm run docs
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

17 changes: 0 additions & 17 deletions .prettierrc.js

This file was deleted.

1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ js_test(
"@com_google_protobuf//:protoc",
] + npm_test_dependencies,
env = {
"PROTOC_PATH": "$(rootpath @com_google_protobuf//:protoc)",
"NODE_OPTIONS": "--no-warnings", # disable ExperimentalWarning about loading JSON modules
},
)
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"compile-protos-js": "pbjs -t static-module -o protos/index.js -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto",
"compile-protos-dts": "pbts protos/index.js -o protos/index.d.ts",
"docker-test": "sh docker/test.sh",
"fix": "gts fix",
"js-test-application": "mocha bazel-bin/typescript/test/test-application/test-js --timeout 600000",
"lint": "gts check",
"prepack": "npm run compile && cd templates/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/",
"postpack": "cd templates/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk",
"test": "bazel test --test_output=errors //:unit_tests",
Expand All @@ -60,13 +58,11 @@
"@types/nunjucks": "^3.2.1",
"@types/object-hash": "^3.0.2",
"@types/yargs": "^17.0.17",
"c8": "^7.12.0",
"espower-typescript": "^10.0.1",
"gts": "^3.1.1",
"mocha": "^10.2.0",
"typescript": "4.9.3"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
}
Loading

0 comments on commit a41dad5

Please sign in to comment.