Last active
May 31, 2021 13:09
-
-
Save hernandazevedo/77739a00ec9e08494277c3e523ec075d to your computer and use it in GitHub Desktop.
.github/workflows
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: Android Pull Request | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
pr-verification: | |
name: PR Check Android | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Gems for Fastlane | |
- name: Cache ruby gems dependencies | |
id: cache-gems | |
uses: actions/cache@v2 | |
env: | |
keyPath: ${{ runner.os }}-gems | |
with: | |
path: ~/.gem | |
key: ${{ runner.os }}-build-${{ env.keyPath }}-${{ hashFiles('Gemfile.lock') }} | |
restore-keys: ${{ runner.os }}-build-${{ env.keyPath }}- | |
- name: Install gem dependencies | |
if: steps.cache-gems.outputs.cache-hit != 'true' | |
run: bundle config set path '~/.gem' && bundle install | |
- name: Cache gradle dependences | |
uses: actions/cache@v2 | |
env: | |
gradle-cache-key: gradle-cache-android | |
gradle-path: ~/.gradle | |
with: | |
path: ${{ env.gradle-path }} | |
key: ${{ runner.os }}-build-${{ env.gradle-cache-key }}-${{ hashFiles('android/buildSrc/**') }} | |
restore-keys: ${{ runner.os }}-build-${{ env.gradle-cache-key }} | |
- name: Run pr check | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} | |
GITHUB_USER: ${{ secrets.REPO_USER }} | |
run: bundle exec fastlane pull_request_verification |
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
### Place this file under directory fastlane/Fastfile | |
### PR Android | |
### | |
desc "Pull Request verification" | |
lane :pull_request_verification do | |
gradle(project_dir: ".", task: "clean lintDebug test") | |
end |
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
### Place this file on root directory of your github repository | |
source 'https://rubygems.org' | |
gem 'fastlane' | |
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') | |
eval_gemfile(plugins_path) if File.exist?(plugins_path) |
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
https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment