From c9eb012e7b27e533ea98750ebe52d859c0fbb52b Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 14 Jun 2024 14:55:00 +0200 Subject: [PATCH] chore: GitHub Action cleanup & run tests on valkey (#6) * chore: GitHub Action cleanup & run tests on valkey Signed-off-by: Matteo Collina * fixup Signed-off-by: Matteo Collina * fixup Signed-off-by: Matteo Collina --------- Signed-off-by: Matteo Collina --- .github/workflows/release.yml | 30 ------------------- .github/workflows/test.yml | 55 ++++++++++++++++++++++++----------- package.json | 5 ++-- 3 files changed, 41 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 514b837f..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release - -on: workflow_dispatch - -concurrency: - group: release_version - cancel-in-progress: true - -jobs: - test: - uses: ./.github/workflows/test.yml - release: - runs-on: ubuntu-latest - needs: test - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: "lts/*" - - run: npm ci - - run: npm run build - - run: npm run docs - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GIT_AUTHOR_NAME: "ioredis robot" - GIT_AUTHOR_EMAIL: "ioredis-robot@zihua.li" - run: npx semantic-release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f760210..800bdd73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,13 +1,22 @@ +name: test + on: - workflow_call: + push: + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' jobs: - test: + test-redis: runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: true matrix: - node: [12.x, 14.x, 16.x, 18.x, 20.x] + node: [18.x, 20.x, 22.x] steps: - name: Git checkout uses: actions/checkout@v2 @@ -27,13 +36,6 @@ jobs: - run: npm run build - run: npm run test:tsd - run: npm run test:cov || npm run test:cov || npm run test:cov - - name: Coveralls - if: matrix.node == '20.x' - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - flag-name: node-${{matrix.node}} - parallel: true test-cluster: runs-on: ubuntu-latest @@ -42,12 +44,31 @@ jobs: - name: Build and test cluster run: bash test/cluster/docker/main.sh - code-coverage: - needs: test + test-valkey: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + node: [18.x, 20.x, 22.x] + + services: + valkey: + image: valkey/valkey:latest + ports: + # Opens tcp port 6379 on the host and service container + - 6379:6379 + steps: - - name: Coveralls - uses: coverallsapp/github-action@master + - name: Git checkout + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true + node-version: ${{ matrix.node }} + + - run: npm install + - run: npm run lint + - run: npm run build + - run: npm run test:tsd + - run: npm run test:cov || npm run test:cov || npm run test:cov diff --git a/package.json b/package.json index 460a7e1a..7dfd954e 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,12 @@ "format": "prettier --write \"{,!(node_modules)/**/}*.{js,ts}\"", "format-check": "prettier --check \"{,!(node_modules)/**/}*.{js,ts}\"", "build": "rm -rf built && tsc", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "start-valkey": "docker run -p 6379:6379 valkey/valkey" }, "repository": { "type": "git", - "url": "git://github.com/mcollina/iovalkey.git" + "url": "git://github.com/valkey/iovalkey.git" }, "keywords": [ "redis",