Skip to content

Commit

Permalink
Merge pull request #3 from fernandatoledo/sonar
Browse files Browse the repository at this point in the history
Sonar
  • Loading branch information
fernandatoledo authored Aug 5, 2024
2 parents 17231f0 + ec8ed3b commit a145974
Show file tree
Hide file tree
Showing 89 changed files with 477 additions and 4,195 deletions.
3 changes: 2 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ API_URL=https://dummyjson.com/
## TODO: add the variable to your CI and remove it from here, not recommended setting sensitive values on your git repo
SECRET_KEY=my-secret-key
VAR_NUMBER=10 # this is a number variable
VAR_BOOL=true # this is a boolean variable
VAR_BOOL=true # this is a boolean variable
GOOGLE_MAPS_KEY=AIzaSyA3TXBYVZ3LcS3KjDLfX4RwAqphEC1BvA4 # this is an api key obtained from https://console.cloud.google.com/apis/credentials/key/b68ab780-f2e9-4a2a-b398-340bac811483?authuser=1&project=inbound-aspect-429020-r0
3 changes: 2 additions & 1 deletion .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ API_URL=https://dummyjson.com/
## TODO: add the variable to your CI and remove it from here, not recommended setting sensitive values on your git repo
SECRET_KEY=my-secret-key
VAR_NUMBER=10 # this is a number variable
VAR_BOOL=true # this is a boolean variable
VAR_BOOL=true # this is a boolean variable
GOOGLE_MAPS_KEY=holahola # this is an api key obtained from https://console.cloud.google.com/apis/credentials/key/b68ab780-f2e9-4a2a-b398-340bac811483?authuser=1&project=inbound-aspect-429020-r0
46 changes: 46 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: SonarQube analysis

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
- master
- staging
- qa
- development

env:
SONAR_PROJECT: myapp-delete

jobs:
sonar:
runs-on: ubuntu-latest
steps:
- name: 📦 Checkout project repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install

- name: Run Tests
run: export NODE_OPTIONS=--experimental-vm-modules && pnpm test:ci

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
with:
args: >
-Dsonar.sonar.sources=./src
-Dsonar.qualitygate.wait=true
-Dsonar.projectBaseDir=.
-Dsonar.verbose=false
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
-Dsonar.sonar.sourceEncoding=UTF-8
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.coverage.exclusions=**/storage/**,**/**.config.js,**/*.test.tsx,**/icons/**
45 changes: 43 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,49 @@ yarn-error.log
# macOS
.DS_Store

# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# @generated expo-cli sync-8d4afeec25ea8a192358fae2f8e2fc766bdce4ec
# The following patterns were generated by expo-cli

# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
ios/
android/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

expo-env.d.ts
# @end expo-cli
# @end expo-cli
sonar-scanner.properties
.scannerwork/report-task.txt
.scannerwork/.sonar_lock
38 changes: 38 additions & 0 deletions EAS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Distribute using Expo Application Services

To be able to use Expo Application Services to upload your app to App Store and Google Play Store there are some configurations that need to be done on your side.

### Google Play Store

The first submission of the app needs to be performed manually. Learn more: https://expo.fyi/first-android-submission. Only after having a valid version submitted you can submit automatically using EAS.

To submit an app to google play store you will have to follow the steps in [Uploading a Google Service Account Key for Play Store Submissions with EAS](https://github.com/expo/fyi/blob/main/creating-google-service-account.md) guide, its super detailed and should not take you much time.

Once you've completed the guide you'll be able to submit to the store your EAS builds using the following command:

`eas submit --platform android`

### AppStore

1. Ensure your credentials are configured correctly in EAS. You can do this by running the following command in your terminal:

`eas credentials`

Follow the prompts to authenticate and select your Apple Developer account.

2. Build your app using Expo and EAS:

`eas build --platform ios`

This command initiates the build process for iOS using Expo Application Services.

3. Submit Your Build to the App Store
Once your build is complete, you can submit it to the App Store using the following command:

`eas submit --platform ios`

This command will handle the submission of your build to the App Store using the credentials and configuration you provided.

### Additional Resources

For more detailed instructions on setting up your Apple Developer account, certificates, and provisioning profiles, refer to the [EAS Submits](https://docs.expo.dev/submit/introduction/) docs.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ To run the app on Android
pnpm android
```

## Initial Setup

### Expo Application Services

To be able to use Expo Application Services to upload your app to App Store and Google Play Store follow instructions from this [guide](EAS.md).

### SonarQube

SonarQube is an open-source platform for continuous inspection of code quality. It performs automatic reviews to detect bugs, code smells, and security vulnerabilities. Rootstrap has a SonarQube instance to improve the quality of the software we develop. On each PR, a GitHub Action is triggered to perform the analysis. To set up SonarQube correctly, you need to add the `SONAR_TOKEN`, `SONAR_URL`, and `SONAR_PROJECT` secrets to the repository. Additionally, you must select the quality gate named `ReactNativeTemplate` for your project on SonarQube. In case you're using this project outside Rootstrap and you're not planning to use SonarQube the sonar scanner [worflow](.github/workflows/sonar.yml) should be deleted.

## ✍️ Documentation

- [Rules and Conventions](https://starter.obytes.com/getting-started/rules-and-conventions/)
Expand Down
16 changes: 0 additions & 16 deletions android/.gitignore

This file was deleted.

172 changes: 0 additions & 172 deletions android/app/build.gradle

This file was deleted.

Binary file removed android/app/debug.keystore
Binary file not shown.
14 changes: 0 additions & 14 deletions android/app/proguard-rules.pro

This file was deleted.

7 changes: 0 additions & 7 deletions android/app/src/debug/AndroidManifest.xml

This file was deleted.

Loading

0 comments on commit a145974

Please sign in to comment.