Merge pull request #52 from JetBrains-Research/publishing #338
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: build | |
on: [push] | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Setup Java 17 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Install virtualenv | |
run: | | |
sudo apt update | |
sudo apt install python3-pip | |
python -m pip install virtualenv | |
# Cache Gradle dependencies | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
# Cache Gradle Wrapper | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
build: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
# Setup Java 17 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- uses: actions/checkout@v2 | |
- run: ./gradlew build | |
- name: Upload Test Report | |
uses: actions/upload-artifact@v2 | |
if: ${{ always() }} | |
with: | |
name: test-report | |
path: | | |
build/reports/tests/**/* | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
# Setup Java 17 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- uses: actions/checkout@v2 | |
- name: Run tests | |
run: ./gradlew test | |
code-style: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
# Setup Java 17 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- uses: actions/checkout@v2 | |
- run: ./gradlew ktlintCheck |