From 3e5ebe98da3b27c833f72333f9759eae6fd4808a Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 4 Dec 2025 16:56:24 -0800 Subject: [PATCH 1/4] initi github action --- .github/workflows/travis-ci.yml | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/travis-ci.yml diff --git a/.github/workflows/travis-ci.yml b/.github/workflows/travis-ci.yml new file mode 100644 index 00000000..7537523b --- /dev/null +++ b/.github/workflows/travis-ci.yml @@ -0,0 +1,77 @@ +name: Lint, TS Transpile, and Unit Tests, Migrated from Travis CI + +on: + push: + pull_request: + +jobs: + eslint: + name: Run eslint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: 'npm' + - run: npm install -g eslint@4 + - run: npm run eslint + + typescript-49: + name: TypeScript 4.9 generation and compilation tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: 'npm' + - run: npm install -g typescript@4.9 + - run: | + pushd test/unit/typescript/ + tsc -p . + node -e "require('./api-generation-test').generate()" > generated.ts + tsc generated.ts + + unit-tests: + name: Unit tests (Node.js ${{ matrix.node }}) + runs-on: ubuntu-22.04 + strategy: + matrix: + node: [18.x, 20.x, 22.x] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + - run: npm test + + unit-latest-deps: + name: Unit tests w/ latest dependencies - Node.js 20.x + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.x + - run: rm package-lock.json + - run: rm -rf node_modules + - run: npm install + - run: npm test + + typescript-latest: + name: TypeScript (latest) generation and compilation tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: 'npm' + - run: npm install -g typescript + - run: | + pushd test/unit/typescript/ + tsc -p . + node -e "require('./api-generation-test').generate()" > generated.ts + tsc generated.ts From 51e9aada1bda9b06bba6a72dcdf68e9b4461e00d Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 4 Dec 2025 17:06:43 -0800 Subject: [PATCH 2/4] fix mocha and ts --- .github/workflows/travis-ci.yml | 50 ++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/travis-ci.yml b/.github/workflows/travis-ci.yml index 7537523b..46295148 100644 --- a/.github/workflows/travis-ci.yml +++ b/.github/workflows/travis-ci.yml @@ -26,12 +26,36 @@ jobs: with: node-version: 18.x cache: 'npm' - - run: npm install -g typescript@4.9 + + # Install project dependencies (including @types/node) + - run: npm install + + # Override TypeScript version (locally, not global) + - run: npm install typescript@4.9.x --no-save + + # Run the real test sequence + - run: | + pushd test/unit/typescript/ + npx tsc -p . + node -e "require('./api-generation-test').generate()" > generated.ts + npx tsc generated.ts + + typescript-latest: + name: TypeScript (latest) generation and compilation tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: 'npm' + - run: npm install + - run: npm install typescript --no-save # installs the newest version - run: | pushd test/unit/typescript/ - tsc -p . + npx tsc -p . node -e "require('./api-generation-test').generate()" > generated.ts - tsc generated.ts + npx tsc generated.ts unit-tests: name: Unit tests (Node.js ${{ matrix.node }}) @@ -45,8 +69,10 @@ jobs: with: node-version: ${{ matrix.node }} cache: 'npm' + - run: npm install - run: npm test + unit-latest-deps: name: Unit tests w/ latest dependencies - Node.js 20.x runs-on: ubuntu-22.04 @@ -58,20 +84,4 @@ jobs: - run: rm package-lock.json - run: rm -rf node_modules - run: npm install - - run: npm test - - typescript-latest: - name: TypeScript (latest) generation and compilation tests - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18.x - cache: 'npm' - - run: npm install -g typescript - - run: | - pushd test/unit/typescript/ - tsc -p . - node -e "require('./api-generation-test').generate()" > generated.ts - tsc generated.ts + - run: npm test \ No newline at end of file From e324554fe99bb9e7f3cf1e743376cb774ad1075a Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 4 Dec 2025 17:10:12 -0800 Subject: [PATCH 3/4] clean up and add 24.x --- .github/workflows/travis-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/travis-ci.yml b/.github/workflows/travis-ci.yml index 46295148..0c5c711b 100644 --- a/.github/workflows/travis-ci.yml +++ b/.github/workflows/travis-ci.yml @@ -27,13 +27,10 @@ jobs: node-version: 18.x cache: 'npm' - # Install project dependencies (including @types/node) - run: npm install - # Override TypeScript version (locally, not global) - run: npm install typescript@4.9.x --no-save - # Run the real test sequence - run: | pushd test/unit/typescript/ npx tsc -p . @@ -62,7 +59,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - node: [18.x, 20.x, 22.x] + node: [18.x, 20.x, 22.x, 24.x] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From b181a2815faa65b6649d393ee624fb481e3a7282 Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 4 Dec 2025 17:21:19 -0800 Subject: [PATCH 4/4] del travis.yml --- .travis.yml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eee0ef33..00000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: node_js -dist: jammy -sudo: false -cache: - directories: - - node_modules - -jobs: - include: - - stage: "tests" - name: "Run eslint" - script: "npm install -g eslint@4; npm run eslint;" - node_js: "18" - - name: "TypeScript 4.9 generation and compilation tests" - node_js: "18" - script: - - npm install -g typescript@4.9; - - pushd test/unit/typescript/ - - tsc -p . - - node -e "require('./api-generation-test').generate()" > generated.ts - - tsc generated.ts - - name: "Unit tests - Node.js 20" - node_js: "20" - script: "npm test" - - name: "Unit tests w/ latest dependencies - Node.js 20" - node_js: "20" - script: - - rm package-lock.json - - rm -rf node_modules - - npm install - - npm test - - name: "Unit tests - Node.js 18" - node_js: "18" - script: "npm test" - - name: "Unit tests - Node.js 16" - node_js: "16" - script: "npm test" - - name: "TypeScript (latest) generation and compilation tests" - node_js: "18" - script: - - npm install -g typescript; - - pushd test/unit/typescript/ - - tsc -p . - - node -e "require('./api-generation-test').generate()" > generated.ts - - tsc generated.ts