From 91be078e0f24c0858d644ece61760ae9ba0a5dc7 Mon Sep 17 00:00:00 2001 From: rod-dvla <71075448+rod-dvla@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:01:51 +0100 Subject: [PATCH 1/5] Create node.js.yml --- .github/workflows/node.js.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..017f16d --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,41 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run test + - name: Start LocalStack + run: | + pip install localstack awscli-local[ver1] # install LocalStack cli and awslocal + docker pull localstack/localstack # Make sure to pull the latest version of the image + localstack start -d # Start LocalStack in the background + + echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container + localstack wait -t 30 # to become ready before timing out + echo "Startup complete" + - name: Run some Tests against LocalStack + run: npm run system-test From 0298f397dce0a516f706595077b2d3157684142a Mon Sep 17 00:00:00 2001 From: rod-dvla <71075448+rod-dvla@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:21:42 +0100 Subject: [PATCH 2/5] Update node.js.yml Test against single node version. --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 017f16d..314c94e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x] + node-version: [18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 66e735d227c8074c6ac798e2823ff39323ab0d2b Mon Sep 17 00:00:00 2001 From: rod-dvla <71075448+rod-dvla@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:04:08 +0100 Subject: [PATCH 3/5] Update node.js.yml --- .github/workflows/node.js.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 314c94e..ad87427 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [16.x, 18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -36,6 +36,9 @@ jobs: echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container localstack wait -t 30 # to become ready before timing out - echo "Startup complete" + echo "Startup complete" + - name: Sleep for 30 seconds - Localstack may still be settling + run: sleep 30s + shell: bash - name: Run some Tests against LocalStack run: npm run system-test From cd9852619eb0ef0d2e9e95380c513110b449616f Mon Sep 17 00:00:00 2001 From: rod-dvla <71075448+rod-dvla@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:55:36 +0000 Subject: [PATCH 4/5] Update node.js.yml Try to get localstack bound on IPv4 localhost. --- .github/workflows/node.js.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index ad87427..c8894db 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -41,4 +41,6 @@ jobs: run: sleep 30s shell: bash - name: Run some Tests against LocalStack - run: npm run system-test + run: | + export S3_ENDPOINT=http://127.0.0.1:4566 + npm run system-test From d2a9104b4d3f45fc5c54210be9714ea29b910c20 Mon Sep 17 00:00:00 2001 From: rod-dvla <71075448+rod-dvla@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:19:43 +0000 Subject: [PATCH 5/5] Update node.js.yml --- .github/workflows/node.js.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c8894db..c77d2ba 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -11,7 +11,10 @@ on: jobs: build: - + env: + S3_ENDPOINT: 'http://127.0.0.1:4566' + SQS_ENDPOINT: 'http://127.0.0.1:4566' + runs-on: ubuntu-latest strategy: @@ -37,10 +40,5 @@ jobs: echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container localstack wait -t 30 # to become ready before timing out echo "Startup complete" - - name: Sleep for 30 seconds - Localstack may still be settling - run: sleep 30s - shell: bash - name: Run some Tests against LocalStack - run: | - export S3_ENDPOINT=http://127.0.0.1:4566 - npm run system-test + run: npm run system-test