Add CI/CD #1
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
name: PR Checks | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
validate: | |
name: Validate and Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: TypeScript Check | |
run: yarn tsc --noEmit | |
- name: Lint | |
run: yarn lint | |
- name: Run Tests | |
run: yarn test | |
build-android: | |
name: Build Android | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
NODE_ENV: production | |
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler-cache: true | |
working-directory: android | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Install Fastlane | |
working-directory: android | |
run: bundle install | |
- name: Build Android with Fastlane | |
working-directory: android | |
run: bundle exec fastlane build_and_install | |
build-ios: | |
name: Build iOS | |
runs-on: macos-latest | |
environment: production | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer | |
NODE_ENV: production | |
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler-cache: true | |
working-directory: ios | |
- name: Install Fastlane | |
working-directory: ios | |
run: bundle install | |
- name: Install CocoaPods | |
run: cd ios && pod install | |
- name: Build iOS with Fastlane | |
working-directory: ios | |
run: bundle exec fastlane build_ios |