[_]: feat/tracking payment actions #305
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: SonarCloud analysis | |
on: | |
push: | |
branches: ['master'] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
permissions: | |
pull-requests: read # allows SonarCloud to decorate PRs with analysis results | |
jobs: | |
Analysis: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node_version: [18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
# Generate a .npmrc file with the NPM_TOKEN | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
registry-url: 'https://npm.pkg.github.com' | |
- run: echo REACT_APP_CRYPTO_SECRET=${{ secrets.REACT_APP_CRYPTO_SECRET }} >> .env | |
- run: echo REACT_APP_STRIPE_PK=${{ secrets.REACT_APP_STRIPE_PK }} >> .env | |
- run: echo REACT_APP_STRIPE_TEST_PK=${{ secrets.REACT_APP_STRIPE_TEST_PK }} >> .env | |
- run: echo REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }} >> .env | |
- run: echo REACT_APP_SEGMENT_KEY=${{ secrets.REACT_APP_SEGMENT_KEY }} >> .env | |
- run: echo REACT_APP_MAGIC_IV=${{ secrets.REACT_APP_MAGIC_IV }} >> .env | |
- run: echo REACT_APP_MAGIC_SALT=${{ secrets.REACT_APP_MAGIC_SALT }} >> .env | |
- run: echo REACT_APP_CRYPTO_SECRET2=${{ secrets.REACT_APP_CRYPTO_SECRET2 }} >> .env | |
- run: echo GENERATE_SOURCEMAP=${{ secrets.GENERATE_SOURCEMAP }} >> .env | |
- run: echo REACT_APP_RECAPTCHA_V3=${{ secrets.REACT_APP_RECAPTCHA_V3 }} >> .env | |
- run: echo REACT_APP_STORJ_BRIDGE=${{ secrets.REACT_APP_STORJ_BRIDGE }} >> .env | |
- run: echo REACT_APP_HOSTNAME=${{ secrets.REACT_APP_HOSTNAME }} >> .env | |
- run: echo REACT_APP_PROXY=${{ secrets.REACT_APP_PROXY }} >> .env | |
- run: echo REACT_APP_DONT_USE_PROXY=${{ secrets.REACT_APP_DONT_USE_PROXY }} >> .env | |
- run: echo REACT_APP_SENTRY_DSN=${{ secrets.REACT_APP_SENTRY_DSN }} >> .env | |
- run: echo REACT_APP_PAYMENTS_API_URL=${{ secrets.REACT_APP_PAYMENTS_API_URL }} >> .env | |
- run: echo REACT_APP_DRIVE_NEW_API_URL=${{ secrets.REACT_APP_DRIVE_NEW_API_URL }} >> .env | |
- run: echo REACT_APP_NODE_ENV=production >> .env | |
- run: echo "registry=https://registry.yarnpkg.com/" > .npmrc | |
- run: echo "@internxt:registry=https://npm.pkg.github.com" >> .npmrc | |
# You cannot read packages from other private repos with GITHUB_TOKEN | |
# You have to use a PAT instead https://github.com/actions/setup-node/issues/49 | |
- run: echo //npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }} >> .npmrc | |
- run: echo "always-auth=true" >> .npmrc | |
- name: Install | |
run: yarn install | |
- name: Check and Install Playwright | |
run: yarn playwright install | |
- name: Unit test run | |
run: yarn test:coverage | |
# Analyze with SonarCloud | |
- name: Analyze with SonarCloud | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) |