From 3ab96d42c986c95a0afe6f1205c93dfe3e6b17a8 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 14 Jun 2024 14:46:15 +0200 Subject: [PATCH] chore: GitHub Action cleanup & run tests on valkey Signed-off-by: Matteo Collina --- .github/workflows/release.yml | 30 --------------------- .github/workflows/test.yml | 51 +++++++++++++++++++++++++++-------- package.json | 5 ++-- 3 files changed, 43 insertions(+), 43 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..1a7891e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,13 +1,20 @@ 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 +34,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,6 +42,35 @@ jobs: - name: Build and test cluster run: bash test/cluster/docker/main.sh + 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: Git checkout + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + 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 + code-coverage: needs: test runs-on: ubuntu-latest 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",