.github/workflows/test-and-release.yml in excavate-0.3.1 vs .github/workflows/test-and-release.yml in excavate-0.3.2
- old
+ new
@@ -8,58 +8,81 @@
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
-jobs:
- prepare:
- runs-on: ubuntu-latest
- outputs:
- head_tag: ${{ steps.check.outputs.head_tag }}
- foreign_pr: ${{ steps.check.outputs.foreign_pr }}
- steps:
- - name: Checkout
- uses: actions/checkout@v2.3.4
+env:
+ BUNDLER_VER: 2.3.24
+# Forcing bundler version to ensure that it is consistent everywhere and
+# does not cause bundler gem reinstalls
+# bundler/rubygems 2.3.22 is a minimal requirement to support gnu/musl differentiation
+# https://github.com/rubygems/rubygems/pull/4488
- - name: Retrieve tags
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
- - name: Set output variables
- id: check
- run: |
- fpr="no"
- tag=""
- if [[ "${{ github.ref }}" == refs/heads/* ]]; then
- tag="$(git tag --points-at HEAD)"
- elif [[ "${{ github.ref }}" == refs/pull/* ]] && [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.pull_request.base.repo.full_name }}" ]; then
- fpr="yes"
- fi
- echo "::set-output name=foreign_pr::${fpr}"
- echo "::set-output name=head_tag::${tag}"
-
+jobs:
test:
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
- needs: prepare
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: false
matrix:
- ruby: [ '2.6', '2.7', '3.0', '3.1' ]
+ ruby: [ '2.7', '3.0', '3.1' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
+ bundler: ${{ env.BUNDLER_VER }}
bundler-cache: true
- run: bundle exec rspec
+ metanorma:
+ name: Test with Metanorma on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ continue-on-error: false
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby: [ '2.7', '3.0', '3.1' ]
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ repository: metanorma/metanorma
+
+ - uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main
+
+ - uses: actions/checkout@v3
+ with:
+ path: "excavate"
+
+ - run: 'echo ''gem "excavate", path: "./excavate"'' > Gemfile.devel'
+
+ # https://github.com/rubygems/rubygems/issues/5160
+ - if: matrix.ruby == '3.0'
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ bundler-cache: true
+ bundler: ${{ env.BUNDLER_VER }}
+ rubygems: latest
+
+ - if: matrix.ruby != '3.0'
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ bundler: ${{ env.BUNDLER_VER }}
+ bundler-cache: true
+
+ - run: bundle exec rake
+
release:
name: Release gem
- needs: test
+ needs: [ test, metanorma ]
runs-on: ubuntu-latest
if: contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3