From 406f9e9da39eb217869f9c3ce6c21879e25e3317 Mon Sep 17 00:00:00 2001 From: Alina Sireneva Date: Thu, 21 Sep 2023 00:47:57 +0300 Subject: [PATCH] ci: setup some ci testing --- .github/workflows/test.yaml | 37 +++++++++++++++++++++++++++++++++++++ README.md | 5 ++--- tsconfig.json | 4 +--- 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..1d2c2fe3 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,37 @@ +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# +jobs: + test: + runs-on: ubuntu-latest + + # This job uses a matrix strategy to run the job four times, once for each specified Node version. For more information, see "[AUTOTITLE](/actions/using-jobs/using-a-matrix-for-your-jobs)." + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - run: pnpm install --frozen-lockfile + - name: 'TL codegen' + run: pnpm -C packages/tl run gen-code + - name: 'TypeScript' + run: pnpm run lint:tsc + - name: 'ESLint' + env: + NODE_OPTIONS: "--max_old_space_size=4096" + run: pnpm run lint + - run: pnpm run test:all \ No newline at end of file diff --git a/README.md b/README.md index df4f6fa0..51e3d05f 100644 --- a/README.md +++ b/README.md @@ -54,14 +54,13 @@ npm install @mtcute/node # or any other package ## Setting up for development: ```bash -fnm use # or `nvm use` git clone https://github.com/mtcute/mtcute +fnm use # or `nvm use` cd mtcute pnpm install --frozen-lockfile # generate code from tl schema -cd packages/tl -pnpm run gen-code +pnpm -C packages/tl run gen-code ``` ## cat in a readme 🐈 diff --git a/tsconfig.json b/tsconfig.json index 025cfffb..32036028 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,8 +29,6 @@ ] }, "exclude": [ - "private", - "node_modules", - "dist" + "**/node_modules", ] }