Merge pull request #68 from livefront/gemfile-update #213
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: CI | |
on: | |
push: | |
pull_request: | |
env: | |
RUBY_VERSION: 2.7.2 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: | |
- 17 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Prepare Cache | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -fr ~/.gradle/caches/*/plugin-resolution/ | |
- name: Cache Gradle Files | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: v1-${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
v1-${{ runner.os }}-gradle-${{ matrix.java-version }}- | |
- name: Configure Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
bundler-cache: true | |
- name: Configure JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java-version }} | |
- name: Test | |
run: ./gradlew check koverXmlReport | |
- name: Danger | |
# Run Danger for PRs originating from within the repo (for fork PRs the token won't give permission to comment) | |
if: github.event_name == 'pull_request' && matrix.java-version == '17' && github.event.pull_request.head.repo.full_name == github.repository | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: bundle exec danger |