Skip to content

Commit

Permalink
added other steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Cabrera committed Jan 11, 2024
1 parent 7953753 commit 52a9c0f
Showing 1 changed file with 162 additions and 162 deletions.
324 changes: 162 additions & 162 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,175 +18,175 @@ permissions:
contents: read

jobs:
# split-tests:
# 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'] }}
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - id: set-test-chunks
# name: Set Chunks
# run: echo "::set-output name=test-chunks::$(yarn --silent test --listTests --json | jq -cM '[_nwise(length / 4 | 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)')"
# env:
# CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
split-tests:
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'] }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- id: set-test-chunks
name: Set Chunks
run: echo "::set-output name=test-chunks::$(yarn --silent test --listTests --json | jq -cM '[_nwise(length / 4 | 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)')"
env:
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}

# test:
# runs-on: ubuntu-latest
# name: test (chunk ${{ matrix.chunk }})
# needs:
# - split-tests
# strategy:
# matrix:
# chunk: ${{ fromJson(needs.split-tests.outputs['test-chunk-ids']) }}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - name: 📈 Run GraphQL Codegen
# run: |
# yarn gql:codegen
# yarn gql:schema
# - name: 🧪 Test (chunk ${{ matrix.chunk }})
# run: echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs yarn test:coverage --ci
# env:
# CHUNKS: ${{ needs.split-tests.outputs['test-chunks'] }}
# - name: Codecov
# run: bash <(curl -s https://codecov.io/bash)
test:
runs-on: ubuntu-latest
name: test (chunk ${{ matrix.chunk }})
needs:
- split-tests
strategy:
matrix:
chunk: ${{ fromJson(needs.split-tests.outputs['test-chunk-ids']) }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- name: 📈 Run GraphQL Codegen
run: |
yarn gql:codegen
yarn gql:schema
- name: 🧪 Test (chunk ${{ matrix.chunk }})
run: echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs yarn test:coverage --ci
env:
CHUNKS: ${{ needs.split-tests.outputs['test-chunks'] }}
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)

# eslint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - name: 📈 Run GraphQL Codegen
# run: |
# yarn gql:codegen
# yarn gql:schema
# - name: 💨 ESLint
# run: yarn lint
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- name: 📈 Run GraphQL Codegen
run: |
yarn gql:codegen
yarn gql:schema
- name: 💨 ESLint
run: yarn lint

# typescript:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - name: 📈 Run GraphQL Codegen
# run: |
# yarn gql:codegen
# yarn gql:schema
# - name: ✅ TypeScript lint
# run: yarn lint:ts
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- name: 📈 Run GraphQL Codegen
run: |
yarn gql:codegen
yarn gql:schema
- name: ✅ TypeScript lint
run: yarn lint:ts

# prettier:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - name: 💅 Prettier Check
# run: yarn prettier:check
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- name: 💅 Prettier Check
run: yarn prettier:check

# onesky-upload:
# runs-on: ubuntu-latest
# needs: [test, eslint, typescript, prettier]
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ secrets.AWS_IAM_ONESKY_ROLE_ARN }}
# aws-region: us-east-1
# - name: Import OneSky Keys
# uses: dkershner6/aws-ssm-getparameters-action@v1
# with:
# parameterPairs: |
# /shared/onesky/PUBLIC_KEY = ONESKY_API_KEY,
# /shared/onesky/SECRET_KEY = ONESKY_SECRET_KEY
# - name: ⛅🔼 OneSky Upload
# run: yarn onesky:upload
onesky-upload:
runs-on: ubuntu-latest
needs: [test, eslint, typescript, prettier]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_IAM_ONESKY_ROLE_ARN }}
aws-region: us-east-1
- name: Import OneSky Keys
uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: |
/shared/onesky/PUBLIC_KEY = ONESKY_API_KEY,
/shared/onesky/SECRET_KEY = ONESKY_SECRET_KEY
- name: ⛅🔼 OneSky Upload
run: yarn onesky:upload

# ios-codepush:
# runs-on: ubuntu-latest
# needs: [test, eslint, typescript, prettier]
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 14
# - uses: egordm/gha-yarn-node-cache@v1
# - name: 📦 Install Dependencies
# run: yarn
# - name: 📈 Run GraphQL Codegen
# run: |
# yarn gql:codegen
# yarn gql:schema
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ secrets.AWS_IAM_ONESKY_ROLE_ARN }}
# aws-region: us-east-1
# - name: Import OneSky Keys
# uses: dkershner6/aws-ssm-getparameters-action@v1
# with:
# parameterPairs: |
# /shared/onesky/PUBLIC_KEY = ONESKY_API_KEY,
# /shared/onesky/SECRET_KEY = ONESKY_SECRET_KEY
# - name: ⛅ OneSky Download
# run: yarn onesky:download
# - name: 🏗️🚀🍏 Build and Codepush iOS
# env:
# APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
# # Codepush can't figure out how to parse MARKETING_VERSION https://github.com/microsoft/react-native-code-push/issues/1665 https://stackoverflow.com/a/58769925/665224
# run: yarn codepush-ios-staging --token "$APPCENTER_TOKEN" --sourcemap-output sourcemap.ios.js --extra-bundler-option="--sourcemap-sources-root" --extra-bundler-option="./" --description "#${{ github.run_id }} ${{ github.sha }} | ${{ github.event.head_commit.message }}" -t `sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' ./ios/MissionHub.xcodeproj/project.pbxproj`
# - name: 🔼🍏🗺️ Upload iOS sourcemaps to Rollbar
# env:
# ROLLBAR_POST_SERVER_ITEM_TOKEN: ${{ secrets.ROLLBAR_POST_SERVER_ITEM_TOKEN }}
# run: |
# curl https://api.rollbar.com/api/1/sourcemap \
# -F access_token=$ROLLBAR_POST_SERVER_ITEM_TOKEN \
# -F version=${{ github.sha }}.ios \
# -F minified_url=http://reactnativehost/main.jsbundle \
# -F [email protected]
ios-codepush:
runs-on: ubuntu-latest
needs: [test, eslint, typescript, prettier]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: egordm/gha-yarn-node-cache@v1
- name: 📦 Install Dependencies
run: yarn
- name: 📈 Run GraphQL Codegen
run: |
yarn gql:codegen
yarn gql:schema
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_IAM_ONESKY_ROLE_ARN }}
aws-region: us-east-1
- name: Import OneSky Keys
uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: |
/shared/onesky/PUBLIC_KEY = ONESKY_API_KEY,
/shared/onesky/SECRET_KEY = ONESKY_SECRET_KEY
- name: ⛅ OneSky Download
run: yarn onesky:download
- name: 🏗️🚀🍏 Build and Codepush iOS
env:
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
# Codepush can't figure out how to parse MARKETING_VERSION https://github.com/microsoft/react-native-code-push/issues/1665 https://stackoverflow.com/a/58769925/665224
run: yarn codepush-ios-staging --token "$APPCENTER_TOKEN" --sourcemap-output sourcemap.ios.js --extra-bundler-option="--sourcemap-sources-root" --extra-bundler-option="./" --description "#${{ github.run_id }} ${{ github.sha }} | ${{ github.event.head_commit.message }}" -t `sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' ./ios/MissionHub.xcodeproj/project.pbxproj`
- name: 🔼🍏🗺️ Upload iOS sourcemaps to Rollbar
env:
ROLLBAR_POST_SERVER_ITEM_TOKEN: ${{ secrets.ROLLBAR_POST_SERVER_ITEM_TOKEN }}
run: |
curl https://api.rollbar.com/api/1/sourcemap \
-F access_token=$ROLLBAR_POST_SERVER_ITEM_TOKEN \
-F version=${{ github.sha }}.ios \
-F minified_url=http://reactnativehost/main.jsbundle \
-F [email protected]
# android-codepush:
android-codepush:
# runs-on: ubuntu-latest
# needs: [test, eslint, typescript, prettier]
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down

0 comments on commit 52a9c0f

Please sign in to comment.