|
| 1 | +name: tests/node-latest |
| 2 | + |
| 3 | +# Early-warning canary for new Node.js releases. |
| 4 | +# |
| 5 | +# Node.js ships a new major every 6 months (April/October) and minor/patch |
| 6 | +# releases of the current line roughly every 2-4 weeks, so a weekly run is |
| 7 | +# enough to catch a breaking release within days. The regular test matrix |
| 8 | +# (RavenClient.yml) pins concrete lines; this workflow always resolves the |
| 9 | +# newest available versions instead. |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +on: |
| 15 | + schedule: |
| 16 | + - cron: '0 10 * * 1' # Mondays 10:00 UTC |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + # `nightly` is allowed to fail: it exists to spot upstream breaks early |
| 24 | + # (like the undici dispatch handler protocol changes), not to gate anything. |
| 25 | + continue-on-error: ${{ matrix.node-version == 'nightly' }} |
| 26 | + |
| 27 | + env: |
| 28 | + RAVENDB_TEST_SERVER_PATH: ./RavenDB/Server/Raven.Server |
| 29 | + RAVENDB_TEST_SERVER_CERTIFICATE_PATH: ./certs/server.pfx |
| 30 | + RAVENDB_TEST_CLIENT_CERT_PASSPHRASE: client11 |
| 31 | + RAVENDB_TEST_CLIENT_CERT_PATH: ./certs/nodejs.pem |
| 32 | + RAVENDB_TEST_CA_PATH: /usr/local/share/ca-certificates/ca.crt |
| 33 | + RAVENDB_TEST_HTTPS_SERVER_URL: https://localhost:8989 |
| 34 | + RAVENDB_BUILD_TYPE: nightly |
| 35 | + RAVEN_License: ${{ secrets.RAVEN_LICENSE }} |
| 36 | + RAVENDB_SERVER_VERSION: ${{ matrix.serverVersion }} |
| 37 | + |
| 38 | + strategy: |
| 39 | + matrix: |
| 40 | + # `latest` = newest stable release (any line), `nightly` = tip of main. |
| 41 | + node-version: [latest, nightly] |
| 42 | + serverVersion: ["7.2"] |
| 43 | + fail-fast: false |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + |
| 48 | + - name: Use Node.js ${{ matrix.node-version }} |
| 49 | + uses: actions/setup-node@v4 |
| 50 | + with: |
| 51 | + node-version: ${{ matrix.node-version }} |
| 52 | + check-latest: true |
| 53 | + |
| 54 | + - name: Print resolved Node.js version |
| 55 | + run: node --version |
| 56 | + |
| 57 | + - name: Download RavenDB Server |
| 58 | + run: wget -O RavenDB.tar.bz2 "https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest?buildType=${{ env.RAVENDB_BUILD_TYPE }}&version=${{ matrix.serverVersion }}" |
| 59 | + |
| 60 | + - run: mkdir certs |
| 61 | + - run: openssl genrsa -out certs/ca.key 2048 |
| 62 | + - run: openssl req -new -x509 -key certs/ca.key -out certs/ca.crt -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test CA/OU=RavenDB test CA/CN=localhost/emailAddress=ravendbca@example.com" |
| 63 | + - run: openssl genrsa -traditional -out certs/localhost.key 2048 |
| 64 | + - run: openssl req -new -key certs/localhost.key -out certs/localhost.csr -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test/OU=RavenDB test/CN=localhost/emailAddress=ravendb@example.com" -addext "subjectAltName = DNS:localhost" |
| 65 | + - run: openssl x509 -req -extensions ext -extfile test/Assets/test_cert.conf -in certs/localhost.csr -CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial -out certs/localhost.crt |
| 66 | + - run: cat certs/localhost.key certs/localhost.crt > certs/nodejs.pem |
| 67 | + - run: openssl pkcs12 -passout pass:"" -export -out certs/server.pfx -inkey certs/localhost.key -in certs/localhost.crt |
| 68 | + - run: sudo cp certs/ca.crt /usr/local/share/ca-certificates/ca.crt |
| 69 | + - run: sudo update-ca-certificates |
| 70 | + |
| 71 | + - name: Extract RavenDB Server |
| 72 | + run: tar xjf RavenDB.tar.bz2 |
| 73 | + |
| 74 | + - run: npm ci |
| 75 | + |
| 76 | + - name: Run Tests |
| 77 | + run: npm run test |
| 78 | + |
| 79 | + - name: Build |
| 80 | + run: npm pack |
| 81 | + |
| 82 | + - name: Check imports CommonJS |
| 83 | + run: node scripts/checkImports.cjs |
| 84 | + |
| 85 | + - name: Check imports ESM |
| 86 | + run: node scripts/checkImports.mjs |
| 87 | + |
| 88 | + - name: Check imports |
| 89 | + run: npm run check-imports |
0 commit comments