name: test-and-release on: push: branches: [ main ] tags: [ 'v*' ] pull_request: concurrency: group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' cancel-in-progress: true jobs: prepare: uses: metanorma/ci/.github/workflows/prepare-rake.yml@main test: name: Test on Ruby ${{ matrix.ruby.version }} ${{ matrix.os }} runs-on: ${{ matrix.os }} needs: prepare if: needs.prepare.outputs.push-for-tag != 'true' continue-on-error: ${{ matrix.ruby.experimental }} strategy: fail-fast: false max-parallel: 5 matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby.version }} rubygems: ${{ matrix.ruby.rubygems }} bundler-cache: true - if: matrix.os == 'macos-latest' run: | brew install lcdf-typetools bundle exec rspec env: TEST_ENV: CI - if: matrix.os != 'macos-latest' run: bundle exec rspec --tag ~dev env: TEST_ENV: CI archlinux-test: name: Test on Arch Linux runs-on: ubuntu-latest container: image: 'archlinux:latest' continue-on-error: false strategy: fail-fast: false steps: - uses: actions/checkout@v3 - name: Setup packages run: pacman -Syu --noconfirm git ruby binutils gcc autoconf make libffi - run: bundle install - name: Test run: bundle exec rspec --tag ~dev release: name: Release gem needs: [ test, archlinux-test ] runs-on: ubuntu-latest if: contains(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 bundler-cache: true - uses: actions-mn/gem-release@main with: api-key: ${{ secrets.FONTIST_CI_RUBYGEMS_API_KEY }} release-command: bundle exec rake release