Enforce that a semver label is present on PRs #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# The default triggers for pull requests are opened, synchronize, and reopened. | |
# Add labeled and unlabeled to the list of triggers so that the | |
# check_for_semver_pr_label job is run when a label is added or removed from a | |
# pull request. | |
types: [opened, synchronize, reopened, labeled, unlabeled] | |
jobs: | |
check_for_semver_pr_label: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check that a semver label is present on the PR | |
if: github.event_name == 'pull_request' | |
uses: docker://agilepathway/pull-request-label-checker:latest | |
with: | |
one_of: major,minor,patch,trivial | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
needs: [check_for_semver_pr_label] | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
["2.7", "3.0", "3.1", "3.2", "head", "jruby-head", "truffleruby-head"] | |
operating-system: [ubuntu-latest] | |
include: | |
- ruby: 3.1 | |
operating-system: windows-latest | |
# - ruby: jruby-head | |
# operating-system: windows-latest | |
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }} | |
runs-on: ${{ matrix.operating-system }} | |
env: | |
JAVA_OPTS: -Djdk.io.File.enableADS=true | |
JRUBY_OPTS: --debug | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Initialize Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Run rake | |
run: bundle exec rake | |
coverage: | |
needs: [build] | |
runs-on: ubuntu-latest | |
name: Report test coverage to CodeClimate | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Initialize Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
- name: Run tests | |
run: bundle exec rake spec | |
- name: Report test coverage | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: d3bf532dce7cc5d9ae5ae10efd7708d8465d3cc6236e5e11377cbef62ed2b32f | |
with: | |
coverageLocations: ${{github.workspace}}/coverage/lcov/*.lcov:lcov |