From 7b4505554fb90d4444c7532c0c09052989b67e89 Mon Sep 17 00:00:00 2001 From: Alberto Ricart Date: Wed, 3 Jul 2024 09:07:38 -0500 Subject: [PATCH] [CI] run modules tests in matrix --- .github/workflows/core.yml | 6 ++--- .github/workflows/jetstream.yml | 6 ++--- .github/workflows/kv.yml | 6 ++--- .github/workflows/obj.yml | 6 ++--- .github/workflows/services.yml | 6 ++--- .github/workflows/test.yml | 40 +++++++++++++++++---------------- 6 files changed, 36 insertions(+), 34 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index b09e9306..27b0495f 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -10,19 +10,19 @@ on: - '*' jobs: test: - name: ${{ matrix.config.kind }} ${{ matrix.config.os }} + name: test core with released dependencies runs-on: ubuntu-latest-4-cores environment: CI strategy: matrix: - deno-version: [1.44.4] + deno-version: [1.x.x] permissions: contents: read id-token: write steps: - name: Git Checkout Core - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 diff --git a/.github/workflows/jetstream.yml b/.github/workflows/jetstream.yml index 3ed6bdb0..7c08c2a2 100644 --- a/.github/workflows/jetstream.yml +++ b/.github/workflows/jetstream.yml @@ -9,16 +9,16 @@ on: - '*' jobs: test: - name: ${{ matrix.config.kind }} ${{ matrix.config.os }} + name: test jetstream with released dependencies runs-on: ubuntu-latest-4-cores environment: CI strategy: matrix: - deno-version: [1.44.4] + deno-version: [1.x.x] steps: - name: Git Checkout JetStream - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 diff --git a/.github/workflows/kv.yml b/.github/workflows/kv.yml index 40be3906..c8c562d5 100644 --- a/.github/workflows/kv.yml +++ b/.github/workflows/kv.yml @@ -9,16 +9,16 @@ on: - '*' jobs: test: - name: ${{ matrix.config.kind }} ${{ matrix.config.os }} + name: test kv with released dependencies runs-on: ubuntu-latest-4-cores environment: CI strategy: matrix: - deno-version: [1.44.4] + deno-version: [1.x.x] steps: - name: Git Checkout Kv - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 diff --git a/.github/workflows/obj.yml b/.github/workflows/obj.yml index 256a9635..f1ed1f73 100644 --- a/.github/workflows/obj.yml +++ b/.github/workflows/obj.yml @@ -9,16 +9,16 @@ on: - '*' jobs: test: - name: ${{ matrix.config.kind }} ${{ matrix.config.os }} + name: test obj with released dependencies runs-on: ubuntu-latest-4-cores environment: CI strategy: matrix: - deno-version: [1.44.4] + deno-version: [1.x.x] steps: - name: Git Checkout Obj - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 diff --git a/.github/workflows/services.yml b/.github/workflows/services.yml index 9f186ac2..27fea9c4 100644 --- a/.github/workflows/services.yml +++ b/.github/workflows/services.yml @@ -9,16 +9,16 @@ on: - '*' jobs: test: - name: ${{ matrix.config.kind }} ${{ matrix.config.os }} + name: test services with released dependencies runs-on: ubuntu-latest-4-cores environment: CI strategy: matrix: - deno-version: [1.44.4] + deno-version: [1.x.x] steps: - name: Git Checkout Services - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64ed40ff..d20710cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,19 +8,22 @@ on: - '*' pull_request: branches: [main] + types: [opened, edited, reopened] jobs: test: - name: ${{ matrix.config.kind }} ${{ matrix.config.os }} - runs-on: ubuntu-latest-4-cores - environment: CI strategy: matrix: - deno-version: [1.44.4] + deno-version: [ 1.44.4 ] + module: [ core, jetstream, kv, obj, services ] + + name: test ${{matrix.module}} with local dependencies + runs-on: ubuntu-latest-4-cores + environment: CI steps: - name: Git Checkout Deno Module - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 @@ -34,7 +37,6 @@ jobs: # run: | # sudo echo "145.40.102.131 demo.nats.io" | sudo tee -a /etc/hosts - - name: Install nats-server uses: aricart/install-binary@v1.0.0 with: @@ -47,23 +49,23 @@ jobs: deno fmt --check deno lint - - name: Test Deno Module + - name: Test ${{matrix.module}} Module env: TMPDIR: ${{ runner.temp }} CI: true NGS_CI_USER: ${{ secrets.NGS_CI_USER }} run: | - deno task test - - - name: Build nats.js - run: deno bundle --unstable transport-deno/src/connect.ts nats.js + deno task test-${{ matrix.module }} - - name: Generate lcov - run: deno coverage --unstable --lcov ./coverage > cov.lcov - - - name: Upload coverage - uses: coverallsapp/github-action@1.1.3 - with: - github-token: ${{ secrets.github_token }} - path-to-lcov: ./cov.lcov +# - name: Build nats.js +# run: deno bundle --unstable transport-deno/src/connect.ts nats.js +# +# - name: Generate lcov +# run: deno coverage --unstable --lcov ./coverage > cov.lcov +# +# - name: Upload coverage +# uses: coverallsapp/github-action@1.1.3 +# with: +# github-token: ${{ secrets.github_token }} +# path-to-lcov: ./cov.lcov