diff --git a/.github/workflows/travis-ci.yml b/.github/workflows/travis-ci.yml new file mode 100644 index 00000000..0c5c711b --- /dev/null +++ b/.github/workflows/travis-ci.yml @@ -0,0 +1,84 @@ +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 + + - run: npm install typescript@4.9.x --no-save + + - 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/ + npx tsc -p . + node -e "require('./api-generation-test').generate()" > generated.ts + npx 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, 24.x] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + 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 + 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 \ No newline at end of file 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