From 4fb81e9617329c82b219651ea8a0ec8a4a837dcf Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Fri, 4 Dec 2020 11:33:55 +0800 Subject: [PATCH] test: set up Node version matrix to test different versions --- .github/workflows/test.yaml | 2 ++ tests/plugins/common/Dockerfile.agent | 4 +++- tests/plugins/common/base-compose.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 38ecf3d..f210af9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,6 +30,8 @@ jobs: strategy: matrix: node-version: [ 10, 12, 14 ] + env: + SW_NODE_VERSION: ${{ matrix.node-version }} steps: - uses: actions/checkout@v2 with: diff --git a/tests/plugins/common/Dockerfile.agent b/tests/plugins/common/Dockerfile.agent index 7db6aee..4c51529 100644 --- a/tests/plugins/common/Dockerfile.agent +++ b/tests/plugins/common/Dockerfile.agent @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM node:12 +ARG SW_NODE_VERSION + +FROM node:${SW_NODE_VERSION} ARG ROOT=. diff --git a/tests/plugins/common/base-compose.yml b/tests/plugins/common/base-compose.yml index 264b19a..1e16c0a 100644 --- a/tests/plugins/common/base-compose.yml +++ b/tests/plugins/common/base-compose.yml @@ -37,6 +37,8 @@ services: build: context: ../../../ dockerfile: tests/plugins/common/Dockerfile.agent + args: + - SW_NODE_VERSION=${SW_NODE_VERSION:-latest} environment: SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876 networks: