diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 08a074571..26b813283 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -29,14 +29,14 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Build shell: bash env: WHITESOURCE_API_KEY: ${{ secrets.WHITESOURCE_API_KEY }} run: ./ci/build.sh - name: Upload Build Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: artifacts path: artifacts @@ -49,19 +49,20 @@ jobs: fail-fast: false matrix: cloud: [ 'AWS', 'AZURE', 'GCP' ] - nodeVersion: [ '14.x', '16.x', '18.x'] + nodeVersion: [ '14.x', '16.x', '18.x', '20.x'] steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.nodeVersion }} - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: python-version: '3.7' - name: Download Build Artifacts - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: name: artifacts + path: artifacts - name: Install Homebrew Bash shell: bash run: brew install bash @@ -86,20 +87,21 @@ jobs: fail-fast: false matrix: cloud: [ 'AWS', 'AZURE', 'GCP' ] - nodeVersion: [ '14.x', '16.x', '18.x'] + nodeVersion: [ '14.x', '16.x', '18.x', '20.x'] steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.nodeVersion }} - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: python-version: '3.7' architecture: 'x64' - name: Download Build Artifacts - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: name: artifacts + path: artifacts - name: Tests shell: cmd env: @@ -117,11 +119,12 @@ jobs: image: [ 'nodejs-centos7-node14', 'nodejs-centos7-fips'] cloud: [ 'AWS', 'AZURE', 'GCP' ] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Download Build Artifacts - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: name: artifacts + path: artifacts - name: Tests shell: bash env: @@ -129,3 +132,38 @@ jobs: CLOUD_PROVIDER: ${{ matrix.cloud }} TARGET_DOCKER_TEST_IMAGE: ${{ matrix.image }} run: ./ci/test.sh + + test-ubuntu: + needs: build + name: Tests on Ubuntu + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + cloud: [ 'AWS', 'AZURE', 'GCP' ] + nodeVersion: ['18.x', '20.x'] + steps: + - uses: actions/checkout@v4 + - name: Download Build Artifacts + uses: actions/download-artifact@v3 + with: + name: artifacts + path: artifacts + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Tests + shell: bash + env: + PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }} + CLOUD_PROVIDER: ${{ matrix.cloud }} + run: ./ci/test_ubuntu.sh + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + # without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557 + token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }} + fail_ci_if_error: true + + diff --git a/ci/test_mac.sh b/ci/test_mac.sh index b20bd03d5..1affe52f8 100755 --- a/ci/test_mac.sh +++ b/ci/test_mac.sh @@ -2,11 +2,15 @@ # # Test NodeJS for Mac # + +echo "DOWNLOADED" +echo $(ls /Users/runner/work/snowflake-connector-nodejs/snowflake-connector-nodejs/) set -o pipefail THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $THIS_DIR/_init.sh source $THIS_DIR/scripts/set_git_info.sh + export WORKSPACE=$GITHUB_WORKSPACE export SOURCE_ROOT=$GITHUB_WORKSPACE export SHOULD_GENERATE_COVERAGE_REPORT=1 diff --git a/ci/test_ubuntu.sh b/ci/test_ubuntu.sh new file mode 100755 index 000000000..1bc6a65a8 --- /dev/null +++ b/ci/test_ubuntu.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e +# +# Test NodeJS for Ubuntu +# + +echo "DOWNLOADED" +echo $(ls /Users/runner/work/snowflake-connector-nodejs/snowflake-connector-nodejs/) +set -o pipefail +THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source $THIS_DIR/_init.sh +source $THIS_DIR/scripts/set_git_info.sh + +export WORKSPACE=$GITHUB_WORKSPACE +export SOURCE_ROOT=$GITHUB_WORKSPACE +export SHOULD_GENERATE_COVERAGE_REPORT=1 +export SHOULD_SKIP_PROXY_TESTS=1 + +python3 --version +python3 -m venv venv +source venv/bin/activate +pip3 install -U pip +pip3 install -U snowflake-connector-python +$THIS_DIR/container/test_component.sh $SHOULD_GENERATE_COVERAGE_REPORT diff --git a/test/integration/testProxyExecute.js b/test/integration/testProxyExecute.js index 866dfe43f..2ae7c291e 100644 --- a/test/integration/testProxyExecute.js +++ b/test/integration/testProxyExecute.js @@ -8,7 +8,7 @@ const os = require('os'); describe('Execute proxy test', function () { const platform = os.platform(); - if (platform === 'linux') { + if (platform === 'linux' && !process.env.SHOULD_SKIP_PROXY_TESTS) { let connection; const createNodeTSQL = 'create or replace table NodeT(colA number, colB varchar)'; const selectAllSQL = 'select * from NodeT';