Skip to content

Commit

Permalink
ci(github): update and optimize flows (#3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Mar 3, 2023
1 parent 9ae7e9d commit b10cd60
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/broken-links-scan.yml
Expand Up @@ -10,8 +10,8 @@ jobs:
name: Remark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: bahmutov/npm-install@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Expand Up @@ -29,8 +29,8 @@ jobs:
name: Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: bahmutov/npm-install@v1
Expand Down
75 changes: 42 additions & 33 deletions .github/workflows/rapid-test.yml
Expand Up @@ -3,58 +3,67 @@ name: Rapid Test
on:
push:
branches: [master]
paths-ignore:
- '.github/workflows/docs.yml'
- '.markdownlintrc'
- '.remarkignore'
- '.remarkrc.mjs'
- '.retext-spell.dic'
- 'docs/**'
- '**.md'
paths:
- '.github/workflows/rapid-test.yml'
- 'detox/**'
- 'generation/**'
pull_request:
branches: [master]
paths-ignore:
- '.github/workflows/docs.yml'
- '.markdownlintrc'
- '.remarkignore'
- '.remarkrc.mjs'
- '.retext-spell.dic'
- 'docs/**'
- '**.md'
paths:
- '.github/workflows/rapid-test.yml'
- 'detox/**'
- 'generation/**'

jobs:

js:
name: JS & TS
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [14]
runs-on: ${{ matrix.os }}
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: 14
- name: Bootstrap Lerna
run: npx lerna bootstrap --no-ci
env:
DETOX_DISABLE_POD_INSTALL: true
DETOX_DISABLE_POSTINSTALL: true
- name: Lint
- name: Lint source project
run: npm run lint
working-directory: detox
- name: Lint test project
run: npm run lint
working-directory: detox/test
- name: Typings
run: npm test
working-directory: detox/test
- name: Unit tests (Linux)
if: matrix.os == 'ubuntu-latest'
- name: Unit tests
run: npm run unit
working-directory: detox
- name: Unit tests (Windows)
if: matrix.os == 'windows-latest'
run: npm run unit -- --coverageThreshold "{}"
working-directory: detox
- name: Integration tests
run: npm run integration
working-directory: detox/test
- name: Generation tests
run: npm test
working-directory: generation

windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Bootstrap Lerna (Light)
run: npx lerna bootstrap --no-ci --include-dependents --include-dependencies --scope=detox-test
env:
DETOX_DISABLE_POD_INSTALL: true
DETOX_DISABLE_POSTINSTALL: true
- name: Unit tests
run: npm run unit -- --coverageThreshold "{}"
working-directory: detox
- name: Integration tests
run: npm run integration
working-directory: detox/test
8 changes: 4 additions & 4 deletions .github/workflows/website.yml
Expand Up @@ -19,8 +19,8 @@ jobs:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: dorny/paths-filter@v2
Expand All @@ -46,8 +46,8 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: webfactory/ssh-agent@v0.5.0
Expand Down
2 changes: 2 additions & 0 deletions detox/test/.eslintignore
@@ -1,3 +1,5 @@
allure-report
artifacts
coverage
ios
android
Expand Down
2 changes: 0 additions & 2 deletions scripts/ci.android.sh
Expand Up @@ -31,11 +31,9 @@ mkdir -p coverage
pushd detox/test

run_f "npm run build:android"
cp ../coverage/lcov.info ../../coverage/unit.lcov

run_f "npm run e2e:android:genycloud"
cp coverage/lcov.info ../../coverage/e2e-genycloud-ci.lcov
allure generate || echo "Allure is not installed"

run_f "npm run e2e:android -- e2e/01* e2e/02* e2e/03.actions*"
cp coverage/lcov.info ../../coverage/e2e-emulator-ci.lcov
Expand Down
3 changes: 0 additions & 3 deletions scripts/ci.ios.sh
Expand Up @@ -10,11 +10,8 @@ mkdir -p coverage
pushd detox/test

run_f "npm run build:ios"
cp ../coverage/lcov.info ../../coverage/unit.lcov

run_f "npm run e2e:ios"
cp coverage/lcov.info ../../coverage/e2e-ios-ci.lcov
allure generate || echo "Allure is not installed"

run_f "scripts/ci_unhappy.sh ios"

Expand Down
10 changes: 0 additions & 10 deletions scripts/ci.sh
Expand Up @@ -10,13 +10,3 @@ fi

run_f "lerna bootstrap --no-ci"
run_f "lerna run build"

if [ "$1" == 'noGenerate' ]; then
run_f "lerna run test --ignore=generation"
else
run_f "lerna run test"
fi

pushd detox
allure generate || echo "Allure is not installed"
popd
16 changes: 13 additions & 3 deletions scripts/upload_artifact.sh
Expand Up @@ -3,9 +3,9 @@
DATE=`date '+%Y-%m-%d_%H-%M-%S'`

pack() {
BASE_NAME=$1
ARTIFACTS_DIR=$2
CONTEXT=$3
local BASE_NAME=$1
local ARTIFACTS_DIR=$2
local CONTEXT=$3

if [ $CI ]; then
ARTIFACTS_NAME="${BASE_NAME}_${BUILDKITE_BUILD_NUMBER}_${CONTEXT}_${DATE}.tar.gz"
Expand All @@ -19,7 +19,17 @@ pack() {
fi
}

generate_allure_report() {
local ROOT_DIR=$1

cd $ROOT_DIR
[ -d "allure-results" ] && allure generate || echo "No allure-results found."
cd -
}

cd "$(dirname "$0")/.."
generate_allure_report detox
generate_allure_report detox/test
pack artifacts "detox/test/artifacts" "detoxtest"
pack artifacts "examples/demo-react-native/artifacts" "rnexample"
pack artifacts "examples/demo-react-native-jest/artifacts" "rnexamplejest"
Expand Down

0 comments on commit b10cd60

Please sign in to comment.