From 280de0be69a8cc9fccb939cc574bf8e039b4b60e Mon Sep 17 00:00:00 2001 From: Adrian Grucza <46910040+apgrucza@users.noreply.github.com> Date: Fri, 17 Jul 2020 13:30:26 +1000 Subject: [PATCH] CI scripts to exclude devDependencies from Lambda (#10) --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 10 +++++----- package.json | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05ccf9e..a2d117b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,13 +17,13 @@ jobs: with: node-version: ${{ matrix.node-version }} - - run: ./build.sh okta_native + - run: npm run-script test-ci + + - run: npm run-script build-ci okta_native - run: test -f distributions/okta_native/okta_native.zip - - run: ./build.sh rotate_key_pair + - run: npm run-script build-ci rotate_key_pair - run: test -f distributions/rotate_key_pair/rotate_key_pair.zip - - run: npm run-script mocha - - uses: actions/upload-artifact@v2 with: name: packages_${{ matrix.node-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b71031..fda1291 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,13 +21,13 @@ jobs: with: node-version: '10.x' + - name: Run tests + run: npm run-script test-ci + - name: Build okta_native - run: ./build.sh okta_native + run: npm run-script build-ci okta_native - name: Build rotate_key_pair - run: ./build.sh rotate_key_pair - - - name: Run Mocha tests - run: npm run-script mocha + run: npm run-script build-ci rotate_key_pair - name: Create Release id: create_release diff --git a/package.json b/package.json index f5c5279..7d46c0c 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "main": "index.js", "scripts": { "test": "cd tests && npm install && cd .. && node tests/tests.js", - "mocha": "mocha './mocha/*.js'", - "build": "npm install && cd build && npm install && cd .. && node build/build.js" + "test-ci": "npm ci && mocha './mocha/*.js'", + "build": "npm install && cd build && npm install && cd .. && node build/build.js", + "build-ci": "npm ci --production && cd build && npm ci --production && cd .. && node build/build.js" }, "author": "Widen Enterprises", "repository": "github:widen/cloudfront-auth",