diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d564703 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI +on: + push: + branches: ['**'] + paths-ignore: ['*.adoc', 'docs/**'] + pull_request: + branches: [master] + paths-ignore: ['*.adoc', 'docs/**'] + #schedule: + #- cron: '30 2 * * MON' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + activate: + if: | + (github.event_name == 'schedule' && github.repository_owner == 'asciidoctor') || + (github.event_name == 'push') || + (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'docs/')) + runs-on: ubuntu-latest + steps: + - name: Proceed + run: echo ok go + build: + needs: activate + strategy: + matrix: + os: [ubuntu-latest] + ruby: ['2.7'] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Ruby (uses cached dependencies for non-scheduled build) + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: ${{ github.event_name != 'schedule' }} + - name: Install dependencies (scheduled build only) + if: github.event_name == 'schedule' + run: | + bundle config --local path vendor/bundle + bundle --jobs 3 --retry 3 + - name: Run tests + run: bundle exec ruby -w $(bundle exec ruby -e 'print File.join Gem.bindir, %q(rake)') spec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bb8cce6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -dist: bionic -git: - depth: 5 # use depth 5 to leave enough room for concurrent builds -env: - global: - - NOKOGIRI_USE_SYSTEM_LIBRARIES=true -language: ruby -stages: -- test -install: -- bundle config --local path .bundle/gems -- bundle --jobs 3 --retry 3 -script: bundle exec ruby -w $(bundle exec which rake) spec -jobs: - include: - - stage: test - rvm: 2.7.1 - - rvm: 2.3.8