From c73e96a1031be7dc324f4e51559f9625a95f4b9e Mon Sep 17 00:00:00 2001 From: Sergio del Valle Date: Sun, 28 Feb 2021 21:00:09 +0100 Subject: [PATCH] chore(github-actions): add github actions to this repo --- .github/workflows/build.yml | 71 +++++++++++++++++++++++++++ .github/workflows/release.yml | 55 +++++++++++++++++++++ .github/workflows/weekly.yml | 73 ++++++++++++++++++++++++++++ .travis.yml | 90 ----------------------------------- README.md | 2 +- testem.js | 1 - 6 files changed, 200 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/weekly.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..50062e3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,71 @@ +name: build branch + +on: [push, pull_request] + +jobs: + + test: + runs-on: ubuntu-latest + name: Check branch + steps: + - uses: actions/checkout@v2 + + # Install Node 12 + - uses: actions/setup-node@v1 + with: + node-version: 12 + + # Cache node modules + - uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # Install environment + - run: npm config set spin false + - run: npm install -g npm@7 + - run: npm install -g codecov + - run: npm --version + + # Install Dependencies + - run: npm ci + + # Run tests + - run: npm run lint:js + - run: npm run lint:hbs + - run: npm test + - run: codecov --file=coverage/node/lcov.info + - run: codecov --file=coverage/ember/lcov.info + + regression: + needs: test + runs-on: ubuntu-latest + name: Check ember-try for [${{matrix.scenario}}] + strategy: + matrix: + scenario: [ember-lts-2.18, ember-lts-3.4, ember-release, ember-beta, ember-default-with-jquery] + steps: + - uses: actions/checkout@v2 + + # Install Node 12 + - uses: actions/setup-node@v1 + with: + node-version: 12 + + # Install environment + - run: npm config set spin false + - run: npm install -g npm@7 + - run: npm --version + + # Install Dependencies + - run: npm ci + + # Run ember-try + - run: node_modules/.bin/ember try:one ${{matrix.scenario}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bc7102b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: release artifacts + +on: + workflow_run: + branches: + - master + workflows: ["build branch"] + types: + - completed + +jobs: + release: + runs-on: ubuntu-latest + name: Check branch + steps: + - uses: actions/checkout@v2 + + # Install Node 12 + - uses: actions/setup-node@v1 + with: + node-version: 12 + + # Cache node modules + - uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # Install environment + - run: npm config set spin false + - run: npm install -g npm@7 + - run: npm --version + + # Install Dependencies + - run: npm ci + + # Run semantic relase + - run: npx semantic-release + + # Build the project + - run: npm run build -- -prod + + # Deploy to GitHub Pages + # Using https://github.com/marketplace/actions/deploy-to-github-pages + - uses: JamesIves/github-pages-deploy-action@4.0.0 + with: + folder: dist + \ No newline at end of file diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 0000000..1d02da6 --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,73 @@ +name: build branch + +on: + schedule: + - cron: '0 0 * * 0' # weekly + +jobs: + + test: + runs-on: ubuntu-latest + name: Check branch + steps: + - uses: actions/checkout@v2 + + # Install Node 12 + - uses: actions/setup-node@v1 + with: + node-version: 12 + + # Cache node modules + - uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + # Install environment + - run: npm config set spin false + - run: npm install -g npm@7 + - run: npm install -g codecov + - run: npm --version + + # Install Dependencies + - run: npm ci + + # Run tests + - run: npm run lint:js + - run: npm run lint:hbs + - run: npm test + - run: codecov --file=coverage/node/lcov.info + - run: codecov --file=coverage/ember/lcov.info + + regression: + needs: test + runs-on: ubuntu-latest + name: Check ember-try for [${{matrix.scenario}}] + strategy: + matrix: + scenario: [ember-lts-2.18, ember-lts-3.4, ember-release, ember-beta, ember-default-with-jquery] + steps: + - uses: actions/checkout@v2 + + # Install Node 12 + - uses: actions/setup-node@v1 + with: + node-version: 12 + + # Install environment + - run: npm config set spin false + - run: npm install -g npm@7 + - run: npm --version + + # Install Dependencies + - run: npm ci + + # Run ember-try + - run: node_modules/.bin/ember try:one ${{matrix.scenario}} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7cb6594..0000000 --- a/.travis.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -language: node_js -node_js: stable -sudo: false -dist: trusty - -addons: - chrome: stable - -cache: - directories: - - $HOME/.npm - -env: - global: - - JOBS=1 - -jobs: - fail_fast: true - allow_failures: - - env: EMBER_TRY_SCENARIO=ember-canary - - include: - - stage: "Tests" - before_install: - - npm config set spin false - - npm install -g npm@6 - - npm install -g codecov - - npm install -g greenkeeper-lockfile@1 - - npm install -g @commitlint/travis-cli - - npm --version - install: - - if [[ $TRAVIS_BRANCH =~ greenkeeper || $TRAVIS_PULL_REQUEST_BRANCH =~ greenkeeper ]]; then npm install; else npm ci; fi - before_script: - - greenkeeper-lockfile-update - script: - - commitlint-travis - - npm run lint:js - - npm run lint:hbs - - npm test - after_script: - - greenkeeper-lockfile-upload - after_success: - - codecov --file=coverage/node/lcov.info - - codecov --file=coverage/ember/lcov.info - - - stage: "Regression Tests" - env: EMBER_TRY_SCENARIO=ember-lts-2.18 - - env: EMBER_TRY_SCENARIO=ember-lts-3.4 - - env: EMBER_TRY_SCENARIO=ember-release - - env: EMBER_TRY_SCENARIO=ember-beta - - env: EMBER_TRY_SCENARIO=ember-canary - - env: EMBER_TRY_SCENARIO=ember-default-with-jquery - - - stage: "Release" - script: skip - deploy: - provider: script - skip_cleanup: true - script: - - npx semantic-release - - - stage: "Deploy" - script: npm run build -- -prod - deploy: - provider: pages - skip_cleanup: true - github-token: $GH_TOKEN - local-dir: dist - verbose: true - -before_install: - - npm config set spin false - - npm install -g npm@6 - - npm --version - -install: - - npm ci - -script: - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip_cleanup - -stages: - - "Tests" - - "Regression Tests" - - name: "Release" - if: branch = master - - name: "Deploy" - if: branch = master - diff --git a/README.md b/README.md index e2a780a..c455cb2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ember-cli-webcomponents-bundler -[![Build Status](https://travis-ci.com/BBVAEngineering/ember-cli-webcomponents-bundler.svg?branch=master)](https://travis-ci.com/BBVAEngineering/ember-cli-webcomponents-bundler) +[![Build Status](https://github.com/github/docs/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/BBVAEngineering/ember-cli-webcomponents-bundler/actions) [![GitHub version](https://badge.fury.io/gh/BBVAEngineering%2Fember-cli-webcomponents-bundler.svg)](https://badge.fury.io/gh/BBVAEngineering%2Fember-cli-webcomponents-bundler) [![NPM version](https://badge.fury.io/js/ember-cli-webcomponents-bundler.svg)](https://badge.fury.io/js/ember-cli-webcomponents-bundler) [![Dependency Status](https://david-dm.org/BBVAEngineering/ember-cli-webcomponents-bundler.svg)](https://david-dm.org/BBVAEngineering/ember-cli-webcomponents-bundler) diff --git a/testem.js b/testem.js index f5fa73f..e9b1a42 100644 --- a/testem.js +++ b/testem.js @@ -11,7 +11,6 @@ module.exports = { ], browser_args: { Chrome: [ - process.env.TRAVIS ? '--no-sandbox' : null, '--disable-gpu', '--headless', '--remote-debugging-port=0',