Refactor Github Action per b/485167538 #188
Workflow file for this run
This file contains hidden or 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
| # Workflow to run tests | |
| name: MacOS | |
| on: | |
| push: | |
| branches: [ main, kotlin-1.5.31 ] | |
| pull_request: | |
| branches: [ main, kotlin-1.5.31 ] | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| fail-fast: false | |
| # The type of runner that the job will run on | |
| runs-on: macos-latest | |
| steps: | |
| - name: Setup Java 9 | |
| uses: actions/setup-java@v1.4.3 | |
| with: | |
| java-version: '9' | |
| java-package: jdk | |
| architecture: x64 | |
| - name: set JDK_9 environment variable for kotlin compiler | |
| env: | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
| run: echo ::set-env name=JDK_9::$(echo $JAVA_HOME) | |
| - name: Setup Java 11 | |
| uses: actions/setup-java@v1.4.3 | |
| with: | |
| java-version: '11' | |
| java-package: jdk | |
| architecture: x64 | |
| # Checkout | |
| - uses: actions/checkout@v2 | |
| # Build cache | |
| - name: Cache Gradle Cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('**/gradle.properties') }} | |
| # An ordered list of keys to use for restoring the cache if no cache hit occurred for key | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Cache gradle wrapper | |
| uses: actions/cache@v2 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
| # Run tests | |
| - name: test | |
| run: ./gradlew --stacktrace --info test -PcompilerTestEnabled=true | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v2 | |
| with: | |
| name: test-reports | |
| path: compiler-plugin/build/reports |