diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-07-16 19:31:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 19:31:24 +0300 |
commit | 3d571e697e41aedfba2363d0fb896d7ddbb7c01c (patch) | |
tree | 08bc44796a8274bd143e2cceb6e527873ed94cac | |
parent | ad863e1e68179c9b48c6e567076e0602aa3d0e41 (diff) |
Switch to GitHub Actions CI. (#458)
-rw-r--r-- | .github/workflows/test.yml | 83 | ||||
-rw-r--r-- | .travis.yml | 30 | ||||
-rw-r--r-- | README.md | 2 |
3 files changed, 84 insertions, 31 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2dbff35 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,83 @@ +name: Tests +on: [push, pull_request] + +env: + CI: true + RUBY: 2.6.x + +jobs: + run: + name: Node ${{ matrix.node }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node: [6, 8, 10, 12, 14] + + steps: + - uses: actions/checkout@v2 + + - name: Clone twbs/bootstrap repository + uses: actions/checkout@v2 + with: + repository: twbs/bootstrap + ref: v3-dev + path: bootstrap + + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY }} + + - name: Set up Ruby cache + uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('bootstrap/Gemfile') }}-${{ hashFiles('bootstrap/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('bootstrap/Gemfile') }}-${{ hashFiles('bootstrap/Gemfile.lock') }} + ${{ runner.os }}-ruby-v${{ env.RUBY }}- + + - name: Disable gem docs + run: 'echo "gem: --no-document" > ~/.gemrc' + + - name: Set up Bundler + run: gem install bundler -v "~> 1.17" + + - run: ruby --version + - run: gem --version + - run: bundle --version + + - name: Install npm dependencies + run: npm install + + - name: Set up Bootstrap repo, doc deps and build docs + run: | + bundle install --deployment --path "$(pwd)/vendor/bundle" --gemfile bootstrap/Gemfile --jobs=3 --retry=3 + pushd bootstrap && bundle exec jekyll build && popd + + - name: Run tests with Coveralls + run: npm run nyc -- npm run test && npm run qunit + if: matrix.node == 12 + + - name: Run tests + run: npm test + if: matrix.node != 12 + + - name: Run extra tests + run: | + node ./src/cli-main.js --disable W003,W005 "bootstrap/_gh_pages/**/index.html" + node ./src/cli-main.js test/fixtures/x-ua-compatible/missing.html &> x-ua-compatible-missing.output.actual.txt || true + diff test/fixtures/cli/x-ua-compatible-missing.output.txt x-ua-compatible-missing.output.actual.txt + + - name: Run Coveralls + run: npm run coveralls + if: matrix.node == 12 && github.repository == 'twbs/bootlint' && github.event_name == 'push' + env: + COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a5e8654..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: node_js -git: - depth: 5 -node_js: - - "6" - - "8" - - "10" - - "12" - - "14" -install: - - npm install -before_script: - - git clone --depth 1 https://github.com/twbs/bootstrap.git --branch v3-dev || travis_terminate 1 - - bundle install --deployment --path "$(pwd)/vendor/bundle" --gemfile bootstrap/Gemfile --jobs=3 --retry=3 || travis_terminate 1 - - pushd bootstrap && bundle exec jekyll build && popd -script: - - if [ "$TRAVIS_NODE_VERSION" = "12" ]; then npm run nyc -- npm run test && npm run qunit; else npm run test; fi || travis_terminate 1 - - node ./src/cli-main.js --disable W003,W005 "bootstrap/_gh_pages/**/index.html" || travis_terminate 1 - - node ./src/cli-main.js test/fixtures/x-ua-compatible/missing.html &> x-ua-compatible-missing.output.actual.txt || true - - diff test/fixtures/cli/x-ua-compatible-missing.output.txt x-ua-compatible-missing.output.actual.txt -after_success: - - if [ "$TRAVIS_NODE_VERSION" = "12" ]; then npm run coveralls; fi -matrix: - fast_finish: true -cache: - directories: - - node_modules/ - - vendor/bundle/ -notifications: - email: false @@ -1,7 +1,7 @@ # Bootlint [![NPM version](https://img.shields.io/npm/v/bootlint.svg)](https://www.npmjs.com/package/bootlint) -[![Build Status](https://img.shields.io/travis/twbs/bootlint/master.svg)](https://travis-ci.org/twbs/bootlint) +[![Build Status](https://github.com/twbs/bootlint/workflows/Tests/badge.svg)](https://github.com/twbs/bootlint/actions?workflow=Tests) [![Coverage Status](https://img.shields.io/coveralls/twbs/bootlint.svg?branch=master)](https://coveralls.io/r/twbs/bootlint) ![Development Status :: 5 - Production/Stable](https://img.shields.io/badge/maturity-stable-green.svg "Development Status :: 5 - Production/Stable") [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg "MIT License")](https://github.com/twbs/bootlint/blob/master/LICENSE) |