name: 'Build Hilt Gradle plugin' description: 'Builds the Hilt Gradle plugin.' inputs: agp: description: 'The version of AGP to build with.' required: true runs: using: "composite" steps: - name: 'Install Java ${{ env.USE_JAVA_VERSION }}' uses: actions/setup-java@v2 with: distribution: '${{ env.USE_JAVA_DISTRIBUTION }}' java-version: '${{ env.USE_JAVA_VERSION }}' - name: 'Check out repository' uses: actions/checkout@v2 - name: 'Cache local Maven repository' uses: actions/cache@v2 with: path: | ~/.m2/repository !~/.m2/repository/com/google/dagger key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - name: 'Cache Bazel files' uses: actions/cache@v2 with: path: ~/.cache/bazel key: ${{ runner.os }}-bazel-build-${{ github.sha }} restore-keys: | ${{ runner.os }}-bazel-build- - name: 'Cache Gradle files' uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - name: 'Build and install Hilt Gradle plugin local snapshot' run: ./util/deploy-hilt-gradle-plugin.sh "install:install-file" "LOCAL-SNAPSHOT" shell: bash env: AGP_VERSION: '${{ inputs.agp }}' - name: 'Clean bazel cache' # According to the documentation, we should be able to exclude these via # the actions/cache path, e.g. "!~/.cache/bazel/*/*/external/" but that # doesn't seem to work. run: | rm -rf $(bazel info repository_cache) rm -rf ~/.cache/bazel/*/*/external/ shell: bash