Merge pull request #2288 from ably/liveobjects/noop-diffs-and-empty-s… #4464
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2 | |
| with: | |
| submodules: 'recursive' | |
| persist-credentials: false | |
| - name: Reconfigure git to use HTTP authentication | |
| run: > | |
| git config --global url."https://github.com/".insteadOf | |
| ssh://git@github.com/ | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1 | |
| with: | |
| node-version: 20.x | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run format:check | |
| - run: npx tsc --noEmit ably.d.ts modular.d.ts | |
| # Redundant today: `npm ci` above runs `prepare`, which builds `webpack:all`, and its | |
| # ts-loader already typechecks this same tsconfig program - so a type error fails that | |
| # step first. Kept explicit so the guarantee does not rest on that incidental side | |
| # effect: adding `transpileOnly` or dropping the webpack bundles would silently remove | |
| # it, and nothing would tell us. | |
| - run: npx tsc --noEmit -p tsconfig.json | |
| # The error-code union is generated from the ably-common submodule at its pinned | |
| # commit; fail if the committed copy has drifted from the registry. | |
| - run: npm run generate:errorcodes-ts | |
| - run: git diff --exit-code -- src/common/lib/types/errorcodes.ts | |
| # for some reason, this doesn't work in CI using `npx attw --pack .` | |
| - run: npm pack | |
| - run: npx attw ably-$(node -e "console.log(require('./package.json').version)").tgz --summary --exclude-entrypoints 'ably/modular' | |
| # see https://github.com/ably/ably-js/issues/1546 for why we ignore 'false-cjs' currently. | |
| # should remove when switched to auto-generated type declaration files for modular variant of the library. | |
| - run: npx attw ably-$(node -e "console.log(require('./package.json').version)").tgz --summary --entrypoints 'ably/modular' --ignore-rules false-cjs | |
| - run: npm audit --production |