fix: Android UI bugs #5031
Workflow file for this run
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
# This is a basic workflow to help you get started with Actions | |
name: Web CI/CD v1 | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'release type' | |
required: true | |
default: 'qa' | |
targetbranch: | |
description: 'target deployment branch' | |
required: false | |
default: 'staging' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
release: | |
name: Release | |
if: "github.event_name == 'workflow_dispatch'" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.release == 'qa' && 'master' || 'staging' }} | |
- name: setup git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Techadmin" | |
npm install -g auto-changelog | |
- name: update version qa | |
if: "github.event.inputs.release == 'qa'" | |
run: | | |
npm version prerelease -m "chore: release qa version %s [skip build]" | |
git push https://${{ secrets.GIT_AUTH }}@github.com/GoodDollar/GoodDAPP master:${{ github.event.inputs.targetbranch }} --force --follow-tags | |
git push https://${{ secrets.GIT_AUTH }}@github.com/GoodDollar/GoodDAPP master --follow-tags | |
- name: update version prod | |
if: "github.event.inputs.release != 'qa'" | |
run: | | |
npm version minor -m "chore: release prod version %s [skip build]" | |
git push https://${{ secrets.GIT_AUTH }}@github.com/GoodDollar/GoodDAPP staging:${{ github.event.inputs.targetbranch }} --force --follow-tags | |
git checkout master | |
git merge staging | |
git push https://${{ secrets.GIT_AUTH }}@github.com/GoodDollar/GoodDAPP master --follow-tags | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
test-chunk-ids: ${{ steps['set-test-chunk-ids'].outputs['test-chunk-ids'] }} | |
wallet-chunk-id: ${{ steps['set-test-chunk-ids'].outputs['wallet-chunk-id'] }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: set-test-chunks | |
name: Set Chunks | |
run: echo "::set-output name=test-chunks::$(find ./src -path \*/__tests__/*.js | sort | jq -R -s -c 'split("\n")[:-1] | map(select(contains("__util") == false))' | jq -cM '[_nwise(length / 10 | floor)]')" | |
- id: set-test-chunk-ids | |
name: Set Chunk IDs | |
run: | | |
echo "::set-output name=test-chunk-ids::$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" | |
echo "::set-output name=wallet-chunk-id::$(echo $CHUNKS | jq -cM 'to_entries | map(select(.value | .[] | index("GoodWallet"))) | unique | first | .key')" | |
env: | |
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }} | |
test: | |
name: Unit Tests (Chunk ${{ matrix.chunk }}) | |
needs: | |
- setup | |
strategy: | |
matrix: | |
chunk: ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }} | |
if: "github.event_name != 'workflow_dispatch' && !contains(github.event.head_commit.message,'skip ci') && !contains(github.event.head_commit.message,'skip build')" | |
env: | |
REACT_APP_ENV: 'test' | |
TEST_REACT_NATIVE: false | |
BUNDLESIZE_GITHUB_TOKEN: 63f6d1717c6652d63234cf9629977b08f4bac3fd | |
MNEMONIC: 'test test test test test test test test test test test junk' | |
ADMIN_MNEMONIC: 'test test test test test test test test test test test junk' | |
REACT_APP_ADMIN_MNEMONIC: 'test test test test test test test test test test test junk' | |
CI: true | |
CHUNKS: ${{ needs.setup.outputs['test-chunks'] }} | |
WALLET_CHUNK: ${{ needs.setup.outputs['wallet-chunk-id'] }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "wallet chunk id $WALLET_CHUNK chunk ${{ matrix.chunk }}" | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7.x' | |
- name: Install dependencies | |
run: yarn --immutable | |
- uses: actions/cache@v2 | |
id: contractsCache | |
if: matrix.chunk == env.WALLET_CHUNK | |
name: cache goodcontracts | |
with: | |
path: /tmp/goodprotocol | |
key: ${{ hashFiles('node_modules/@gooddollar/goodprotocol/yarn.lock') }} | |
- name: install goodcontracts | |
if: matrix.chunk == env.WALLET_CHUNK | |
run: ./scripts/blockchainTestSetup.sh | |
- name: run local node so providers dont crash in tests | |
if: matrix.chunk != env.WALLET_CHUNK | |
run: yarn run ganache | |
- name: run tests and code coverage | |
env: | |
NODE_OPTIONS: "--max-old-space-size=8192" | |
run: | | |
cat node_modules/@gooddollar/goodcontracts/releases/deployment.json | |
echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs yarn coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel: true | |
flag-name: run-${{ matrix.chunk }} | |
coverage: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |