From 9cbbb31bcb322571ec237b94953cdc414d984b65 Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 23 Aug 2021 12:56:59 +0300 Subject: [PATCH 1/6] fix: add run all test on push --- .github/workflows/{unit-tests.yml => tests.yml} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename .github/workflows/{unit-tests.yml => tests.yml} (65%) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/tests.yml similarity index 65% rename from .github/workflows/unit-tests.yml rename to .github/workflows/tests.yml index 09e54a63df..12dc66ef81 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,14 @@ -name: Unit Tests +name: Tests on: [push] jobs: - build-and-unit: + build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: npm ci - run: npm run bundle - run: npm test + - run: npm run e2e + - run: run run e2e-ci From 167e3c42b42486b5da44a1a8942586f6ed5543bc Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 23 Aug 2021 13:06:55 +0300 Subject: [PATCH 2/6] fix: remove e2e redord step --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 12dc66ef81..b3e243bafa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,4 +11,3 @@ jobs: - run: npm run bundle - run: npm test - run: npm run e2e - - run: run run e2e-ci From 2addd5cce0c4267b4ce90d65c10e0559eeb16edf Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 23 Aug 2021 13:13:48 +0300 Subject: [PATCH 3/6] fix: move travis deploy to github action --- .github/workflows/demo-deploy-s3.yml | 31 +++++++++++++++++++++++++-- .travis.yml | 32 ---------------------------- 2 files changed, 29 insertions(+), 34 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/demo-deploy-s3.yml b/.github/workflows/demo-deploy-s3.yml index efb2ca19a1..e19e96f4d9 100644 --- a/.github/workflows/demo-deploy-s3.yml +++ b/.github/workflows/demo-deploy-s3.yml @@ -6,15 +6,16 @@ on: - v[0-9]*.[0-9]*.[0-9]* jobs: - build-and-unit: + build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: npm ci - run: npm run bundle - run: npm test + - run: npm run e2e deploy: - needs: build-and-unit + needs: build-and-test runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -40,3 +41,29 @@ jobs: run: npm run deploy:demo - name: Invalidate run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DEMO_DISTRIBUTION_ID }} --paths "/*" + publish: + needs: [build-and-test, deploy] + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: "14.x" + - uses: actions/checkout@v2 + - name: cache node modules + uses: actions/cache@v1 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Bundle + run: npm run bundle + - name: Before deploy + run: npm run compile:cli && npm run declarations + - name: Publish to NPM + run: npm publish && cd cli/ && npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: After acript + run: cat ./coverage/lcov.info | coveralls diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 03ac1fa49a..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: node_js -node_js: -- '12' -cache: - directories: - - "~/.cache" -env: - global: - - GH_REF: github.com/Redocly/redoc.git - - GIT_AUTHOR_EMAIL: redoc-bot@users.noreply.github.com - - GIT_AUTHOR_NAME: RedocBot - - secure: apiavCfCQngL9Een1m7MIXMf3bqO3rY4YY59TMBl/yFKi80CEsHPHhgVUkl6hC+aM5PeBt/vgjh37rHMX31j/pcSZ4Z8SO/4Bwr36iHfhSxSEuAQog8P07qWqH7wYYWGIVmF682stgl0fYF+GN92sx/6edFVzsWVECf2G7imtICKSTbhKGm3Dhn2JwGnhD7eyfgZ33omgiaswumdu0xABoXDfqSZR+16fC4Ap5rhv3fXO9ndvRNy1STn376nT+my6e86UrQL4aS/S+HNHgIe1BUs+5cOp6Jgw6t0ie7phY0EAiECsRxy9K4e3Dctv9m6+Wma4+vy65MS0zGyrqey6oyV4l827sCOjrD1qcqc9bX6FlMSouVoNfE4ZjINNAbgigTaiLSoDSPcf5I5smkkM2ezzFOMSZwZxNdaNL2LKb97vc8m/ZUkv0sKZyT7oqVL7aJweEivsSHj5l2KR8Z7XrVB1y2eI6GvyTSa/d+CL4dSRzjh8+IRN047YBrdTKD5IkdT0upfoBu14WPUfFmLKxX+iMCslXRWb6kwojhrWNYmZvL65KRAzJ6+eIPDG/W5QUOpYyYT77bLlBQjVo6NmVvl9v3HMECq9CHH0ivKFBGPiKMOx7cJkTax3FuyznOW2WCXB9kTb5Zk9toaiNlSp9L6ll/h2Eyxa6n6sWUgmmM= - - secure: vVRg9BKGBwF2MbXQnEccFL+XW0/7RaBmge9k7jbGYScBwkP3XjnQ/Xaj0cvTz2CM2EqXsbpwfvr4Jo+enW/E3MGy5RiEzv5hUe/jIFRR0gfAFbZxSTvg5xiFhTDffqQk0fncO4jXu+wPO5lZ2CMRWzyXz3i1MZhjMcAgoDr1+TRss/EGXLNHxr2RM88tpUW0fV2prIRoyGqhCgnYZtrm7hmr41Ej+itg1MqZLml/Rjkt3KsNgI+z0O5Qn3QSAO8GtPZqeftQxAjevOmxZGcssxY8EJvqbjAujr4y51WncXpEmCRPSY2J9R5+fkgZurqwnJapbQpjwKYemok3ps7EHg2gWkAlmPdQO4LKpbffGkM/o5b+8+HdIuQZugsSWQD9hUSftTAFLcfA1isi7V2lHE1m8bX/vk9zIyDdcPSwIaFe9y+w3PexwFmTjPLq+nia/UY2kARFZMEIFAJby6gkA70DcAJ50QOM86InJu5DSzGbIssgTGAXCn0TPPyGveaurVLw8x61j3yh8LDF46gUHey3rqv6WjpCM9h/vg7X/gq5ve/5Q2KHscUKfs/sA53Mt7qPeqRZY1QCaaRjzqJO/ZraHqWWeKmPKaWhPGR0kYEnkvB+K9GZ+HNSWCltjCO4SJ1xeEl7CRqQxAwdiMATF5SKqyiC+bn5oc35mFgbRF8= - - secure: ela1tn4wkJQZ8O4iv+4pIZi5cebxeCStVF1tEUe6qa6WWgJYVXmS2tEv3QQ36NUBFrP58Y6yl10XguPnvj/2BCqcZI4FUBHh3BfiBoUtXxDCVKI5LtlniNiOFGUwfzEeYka8T51zFlcUXSCCaxHkRZbmBsIzeJ39UwTi5fy0qwLv9GgL0czhwm8I8sZ8gyWdGmqpXNFEsb9JP4ZA3mw2qpWkGpGAqQPD9XSCkU3LmX1/ltwsBMAgGYKLLo7vU8d5KV2c8L1Gnxfl6BvfmqUD/dsas/1rnk08rU2nez5ekuQa2tJRkDLOv8bqvrGRLjHSUa3yPuisC6SsDGSU7/3DcozZyYsz7WQ6WI8tYabyjqqeJTF1N8a5T3IbZaZNV1J4JHOO9Cb/y7gIg4edANg6tbe7MzZpdEPRBnw6OkdTdirpNsWQ/jnfpY1hn6mraQZz/q8yaz3W21NjbBJhVnvfh5gWLKQ3YAAziCBhmmrThFhUu0czz+G920MuFo477TBcxvlrE7CaNJ0Q6yYkDehEPOv3jvEs1QVHPwuRrlaLTbBhrlTICKZ58gdX30O8N4i0Xgp/v6qrC03bplnMQc8E/uC61wcVLJixnlZVp8FODpUvPjsxVFkpuNSOIAaiqcERmoiPXx05Epzmr78hjU5rYCx/1MmVoeB4gs9YO+4guD4= -addons: - chrome: stable - apt: - packages: - - libgconf-2-4 -before_script: npm run bundle -script: npm test && ([ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm run e2e-ci || npm - run e2e) -after_script: cat ./coverage/lcov.info | coveralls -before_deploy: npm run compile:cli && npm run declarations -deploy: -- provider: npm - skip_cleanup: true - email: gotsijroman@gmail.com - tag: next - api_key: "$NPM_TOKEN" - on: - tags: true From c8f583cea95ea6e0fc59503aebf4f27ac492cfdc Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 23 Aug 2021 14:46:13 +0300 Subject: [PATCH 4/6] fix: improve publish and test action --- .github/workflows/demo-deploy-s3.yml | 69 -------------- .github/workflows/publish.yml | 136 +++++++++++++++++++++++++++ .github/workflows/tests.yml | 10 +- 3 files changed, 144 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/demo-deploy-s3.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/demo-deploy-s3.yml b/.github/workflows/demo-deploy-s3.yml deleted file mode 100644 index e19e96f4d9..0000000000 --- a/.github/workflows/demo-deploy-s3.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Redoc demo CI/CD - -on: - push: - tags: - - v[0-9]*.[0-9]*.[0-9]* - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: npm ci - - run: npm run bundle - - run: npm test - - run: npm run e2e - deploy: - needs: build-and-test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: cache node modules - uses: actions/cache@v1 - with: - path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: | - npm-${{ hashFiles('package-lock.json') }} - npm- - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: Install dependencies - run: npm ci - - name: Build package - run: npm run build:demo - - name: Deploy to S3 bucket - run: npm run deploy:demo - - name: Invalidate - run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DEMO_DISTRIBUTION_ID }} --paths "/*" - publish: - needs: [build-and-test, deploy] - runs-on: ubuntu-latest - steps: - - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - uses: actions/checkout@v2 - - name: cache node modules - uses: actions/cache@v1 - with: - path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: | - npm-${{ hashFiles('package-lock.json') }} - npm- - - name: Bundle - run: npm run bundle - - name: Before deploy - run: npm run compile:cli && npm run declarations - - name: Publish to NPM - run: npm publish && cd cli/ && npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: After acript - run: cat ./coverage/lcov.info | coveralls diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..d4893a709c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,136 @@ +name: Publish + +on: + push: + tags: + - v[0-9]*.[0-9]*.[0-9]* + +jobs: + bundle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - run: npm ci + - run: npm run bundle + bundle-cli: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - uses: cd cli/ + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Install dependencies + run: npm ci + - name: Bundle + run: npm run compile:cli + unit-tests: + needs: [bundle] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: npm ci + - run: npm test + e2e-tests: + needs: [bundle] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: npm ci + - run: npm run e2e + check-version-cli: + name: Check Version + runs-on: ubuntu-latest + needs: [bundle-cli, unit-tests, e2e-tests] + outputs: + changed: ${{ steps.check.outputs.changed }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + - name: Check if version has been updated + id: check + uses: EndBug/version-check@v2.0.1 + with: + file-name: ./cli/package.json + file-url: https://unpkg.com/redoc-cli/package.json + static-checking: localIsNew + deploy-demo: + needs: [bundle, unit-tests, e2e-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Install dependencies + run: npm ci + - name: Build package + run: npm run build:demo + - name: Deploy to S3 bucket + run: npm run deploy:demo + - name: Invalidate + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DEMO_DISTRIBUTION_ID }} --paths "/*" + publish: + needs: [bundle, unit-tests, e2e-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: "14.x" + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Before deploy + run: npm run declarations + - name: Publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: After acript + run: cat ./coverage/lcov.info | coveralls + publish-cli: + needs: [check-version-cli] + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: "14.x" + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Publish to NPM + run: cd cli/ && npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3e243bafa..fd23d45f9c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,11 +3,17 @@ name: Tests on: [push] jobs: - build-and-test: + unit-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - run: npm ci - run: npm run bundle - run: npm test + e2e-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci + - run: npm run bundle - run: npm run e2e From 7dc7f542b8fc3b43394a74f84818479cf4dd4818 Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Fri, 17 Sep 2021 16:13:50 +0300 Subject: [PATCH 5/6] fix: improve run test after review --- .github/workflows/e2e-tests.yml | 12 ++++++++++++ .github/workflows/tests.yml | 19 ------------------- .github/workflows/unit-tests.yml | 12 ++++++++++++ 3 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/e2e-tests.yml delete mode 100644 .github/workflows/tests.yml create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml new file mode 100644 index 0000000000..514a31939d --- /dev/null +++ b/.github/workflows/e2e-tests.yml @@ -0,0 +1,12 @@ +name: Tests e2e + +on: [push] + +jobs: + build-and-e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci + - run: npm run bundle + - run: npm run e2e diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index fd23d45f9c..0000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Tests - -on: [push] - -jobs: - unit-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: npm ci - - run: npm run bundle - - run: npm test - e2e-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: npm ci - - run: npm run bundle - - run: npm run e2e diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000000..a0a0bbd16a --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,12 @@ +name: Unit Tests + +on: [push] + +jobs: + build-and-unit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: npm ci + - run: npm run bundle + - run: npm test \ No newline at end of file From 937a0261c7f6ca567aab2b44de682bc90fa12c89 Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Fri, 17 Sep 2021 16:15:24 +0300 Subject: [PATCH 6/6] fix: run cli publish in separate workflows --- .github/workflows/publish-cli.yml | 115 ++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 80 ++++++--------------- 2 files changed, 137 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/publish-cli.yml diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml new file mode 100644 index 0000000000..9bfa3ffffe --- /dev/null +++ b/.github/workflows/publish-cli.yml @@ -0,0 +1,115 @@ +name: Publish cli + +on: + push: + tags: + - v[0-9]*.[0-9]*.[0-9]* + + +jobs: + bundle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - run: npm ci + - run: npm run bundle + - name: Store bundle artifact + uses: actions/upload-artifact@v2 + with: + name: bundles-cli + path: bundles + retention-days: 1 + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: npm ci + - run: npm test + e2e-tests: + needs: [bundle] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: npm ci + - name: Download bundled artifact + uses: actions/download-artifact@v2 + with: + name: bundles + path: bundles-cli + - run: npm run e2e + bundle-cli: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Install dependencies + run: npm ci + - name: Bundle + run: npm run compile:cli + - name: Store bundle artifact + uses: actions/upload-artifact@v2 + with: + name: cli + path: cli + retention-days: 1 + check-version-cli: + name: Check Version + runs-on: ubuntu-latest + needs: [bundle-cli, unit-tests, e2e-tests] + outputs: + changed: ${{ steps.check.outputs.changed }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + - name: Check if version has been updated + id: check + uses: EndBug/version-check@v2.0.1 + with: + file-name: ./cli/package.json + file-url: https://unpkg.com/redoc-cli/package.json + static-checking: localIsNew + publish-cli: + needs: [ check-version-cli ] + if: needs.check-version-cli.outputs.changed == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: "14.x" + - uses: actions/checkout@v2 + - name: Download cli bundled artifact + uses: actions/download-artifact@v2 + with: + name: cli + path: cli + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Publish to NPM + run: cd cli/ && npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d4893a709c..d1c9ccbf8a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,26 +21,13 @@ jobs: npm- - run: npm ci - run: npm run bundle - bundle-cli: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - - uses: cd cli/ - - name: Cache node modules - uses: actions/cache@v2 - with: - path: ~/.npm - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: | - npm-${{ hashFiles('package-lock.json') }} - npm- - - name: Install dependencies - run: npm ci - - name: Bundle - run: npm run compile:cli + - name: Store bundle artifact + uses: actions/upload-artifact@v2 + with: + name: bundles + path: bundles + retention-days: 1 unit-tests: - needs: [bundle] runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -52,25 +39,12 @@ jobs: steps: - uses: actions/checkout@v1 - run: npm ci + - name: Download bundled artifact + uses: actions/download-artifact@v2 + with: + name: bundles + path: bundles - run: npm run e2e - check-version-cli: - name: Check Version - runs-on: ubuntu-latest - needs: [bundle-cli, unit-tests, e2e-tests] - outputs: - changed: ${{ steps.check.outputs.changed }} - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Set up Node.js - uses: actions/setup-node@v2 - - name: Check if version has been updated - id: check - uses: EndBug/version-check@v2.0.1 - with: - file-name: ./cli/package.json - file-url: https://unpkg.com/redoc-cli/package.json - static-checking: localIsNew deploy-demo: needs: [bundle, unit-tests, e2e-tests] runs-on: ubuntu-latest @@ -84,6 +58,11 @@ jobs: aws-region: us-east-1 - name: Install dependencies run: npm ci + - name: Download bundled artifacts + uses: actions/download-artifact@v2 + with: + name: bundles + path: bundles - name: Build package run: npm run build:demo - name: Deploy to S3 bucket @@ -98,6 +77,11 @@ jobs: with: node-version: "14.x" - uses: actions/checkout@v2 + - name: Download bundled artifacts + uses: actions/download-artifact@v2 + with: + name: bundles + path: bundles - name: Cache node modules uses: actions/cache@v2 with: @@ -112,25 +96,5 @@ jobs: run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: After acript + - name: After script run: cat ./coverage/lcov.info | coveralls - publish-cli: - needs: [check-version-cli] - runs-on: ubuntu-latest - steps: - - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - uses: actions/checkout@v2 - - name: Cache node modules - uses: actions/cache@v2 - with: - path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: | - npm-${{ hashFiles('package-lock.json') }} - npm- - - name: Publish to NPM - run: cd cli/ && npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}