|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - .github/workflows/ci.yml |
| 7 | + - lib/** |
| 8 | + - spec/** |
| 9 | + |
| 10 | +jobs: |
| 11 | + tests-mri: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + ruby: ["2.6.x", "2.5.x", "2.4.x"] |
| 17 | + include: |
| 18 | + - ruby: "2.6.x" |
| 19 | + coverage: "true" |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v1 |
| 22 | + - name: Set up Ruby |
| 23 | + uses: actions/setup-ruby@v1 |
| 24 | + with: |
| 25 | + ruby-version: ${{matrix.ruby}} |
| 26 | + - name: Download test reporter |
| 27 | + if: "matrix.coverage == 'true'" |
| 28 | + run: | |
| 29 | + mkdir -p tmp/ |
| 30 | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter |
| 31 | + chmod +x ./tmp/cc-test-reporter |
| 32 | + ./tmp/cc-test-reporter before-build |
| 33 | + - name: Run all tests |
| 34 | + env: |
| 35 | + COVERAGE: ${{matrix.coverage}} |
| 36 | + run: | |
| 37 | + gem install bundler |
| 38 | + bundle install --jobs 4 --retry 3 --without tools docs |
| 39 | + bundle exec rake |
| 40 | + - name: Send coverage results |
| 41 | + if: "matrix.coverage == 'true'" |
| 42 | + env: |
| 43 | + CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} |
| 44 | + GIT_COMMIT_SHA: ${{github.sha}} |
| 45 | + GIT_BRANCH: ${{github.ref}} |
| 46 | + GIT_COMMITTED_AT: ${{github.event.head_commit.timestamp}} |
| 47 | + run: | |
| 48 | + GIT_BRANCH=`ruby -e "puts ENV['GITHUB_REF'].split('/', 3).last"` \ |
| 49 | + GIT_COMMITTED_AT=`ruby -r time -e "puts Time.iso8601(ENV['GIT_COMMITTED_AT']).to_i"` \ |
| 50 | + ./tmp/cc-test-reporter after-build |
| 51 | +
|
| 52 | + tests-others: |
| 53 | + runs-on: ubuntu-latest |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + image: ["jruby:9.2.8", "ruby:rc"] |
| 58 | + container: |
| 59 | + image: ${{matrix.image}} |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v1 |
| 62 | + - name: Install git |
| 63 | + run: | |
| 64 | + apt-get update |
| 65 | + apt-get install -y --no-install-recommends git |
| 66 | + - name: Run all tests |
| 67 | + run: | |
| 68 | + gem install bundler |
| 69 | + bundle install --jobs 4 --retry 3 --without tools docs |
| 70 | + bundle exec rspec |
0 commit comments