From 49dc2e6a866c95f56926a96c2a68e48c1e519915 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Fri, 8 Mar 2024 22:58:55 +0100 Subject: [PATCH] test(live): fetch server cert --- .github/workflows/live-test.yaml | 48 +++++++++++++------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/.github/workflows/live-test.yaml b/.github/workflows/live-test.yaml index 37b689c..4adadf5 100644 --- a/.github/workflows/live-test.yaml +++ b/.github/workflows/live-test.yaml @@ -8,40 +8,31 @@ on: paths: - ".github/workflows/live-test.yaml" +env: + HOSTNAME: mqtt.nordicsemi.academy + jobs: - test-ipv4: + # Ensures that the TLS certificate can be fetched + fetch-cert: runs-on: ubuntu-latest - env: - HOSTNAME: mqtt.nordicsemi.academy + strategy: + matrix: + protocol: [http, https] steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: "20.x" - - - name: Keep npm cache around to speed up installs - uses: actions/cache@v4 - with: - path: ~/.npm - key: build-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - run: npm ci --no-audit + - name: fetch TLS certificate + run: http -v ${{ matrix.protocol }}://${{ env.HOSTNAME }}/${{ env.HOSTNAME }}.crt - - name: Run tests (IPv4) - env: - IPV: 4 - HOSTNAME: ${{ env.HOSTNAME }} - run: npx tsx --test test.ts - - test-ipv6: + test-mqtt: runs-on: ubuntu-latest - env: - HOSTNAME: udp-echo.nordicsemi.academy + # needs: + # - fetch-cert + + strategy: + matrix: + ipv: [4, 6] steps: - uses: actions/checkout@v4 @@ -60,10 +51,11 @@ jobs: run: npm ci --no-audit - name: Set up WARP + if: matrix.ipv == 6 uses: fscarmen/warp-on-actions@v1.0 - - name: Run tests (IPv6) + - name: Run tests (IPv4) env: - IPV: 6 + IPV: ${{ matrix.ipv }} HOSTNAME: ${{ env.HOSTNAME }} run: npx tsx --test test.ts