Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub pipeline multiple stage for the test workflow #140

Merged
merged 30 commits into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0b042d1
test: add ci-pipeline
Sakchai-Refinitiv Nov 5, 2021
dd3376c
test: ci init lerna from previous stage
Sakchai-Refinitiv Nov 8, 2021
78c4702
chore: reuse ci workflow
Sakchai-Refinitiv Dec 20, 2021
eab8375
chore: add ci build workflow
Sakchai-Refinitiv Dec 20, 2021
d4a93d2
chore: add ci install workflow
Sakchai-Refinitiv Dec 20, 2021
3ec3f7f
chore: ci reuse lint workflow
Sakchai-Refinitiv Dec 20, 2021
fd3783e
chore: update ci npm cach path
Sakchai-Refinitiv Dec 21, 2021
ad9b75a
chore: ci comparison multiple stage
Sakchai-Refinitiv Dec 21, 2021
f7f5f5c
chore: ci group build step
Sakchai-Refinitiv Dec 21, 2021
b3d4ac2
chore: ci remove build before test
Sakchai-Refinitiv Dec 21, 2021
c92b4e3
chore: ci exclude test workflow
Sakchai-Refinitiv Dec 21, 2021
f4c011f
chore: ci with caching
Sakchai-Refinitiv Dec 22, 2021
971ee5f
chore: ci reuse composite action
Sakchai-Refinitiv Dec 22, 2021
7d56737
chore: ci reuse cache action
Sakchai-Refinitiv Dec 22, 2021
8c878f2
chore: ci run lint and test concurrently
Sakchai-Refinitiv Dec 22, 2021
779133c
chore: ci lint before test
Sakchai-Refinitiv Dec 22, 2021
81371d3
chore: ci test pull request branch
Sakchai-Refinitiv Dec 22, 2021
478d10d
chore: ci add comment about resued Github workflow
Sakchai-Refinitiv Dec 22, 2021
28d1908
chore: ci test pull request branch
Sakchai-Refinitiv Dec 22, 2021
836e409
chore: remove ci event for trigger lint
Sakchai-Refinitiv Dec 22, 2021
2070bb4
Merge branch 'test-develop' into improve-ci
Sakchai-Refinitiv Dec 22, 2021
45ff910
chore: update ci workflow comment
Sakchai-Refinitiv Dec 22, 2021
056fbe3
chore: ci use setup actions instead of link to workflows
Sakchai-Refinitiv Dec 22, 2021
e90fec5
chore: update ci github action setup
Sakchai-Refinitiv Dec 22, 2021
b346d0e
chore: ci update step name
Sakchai-Refinitiv Dec 22, 2021
d4702c4
chore: ci update incorrect run command
Sakchai-Refinitiv Dec 22, 2021
4c4d2a3
Merge remote-tracking branch 'origin/develop' into improve-ci
phetw Dec 23, 2021
4c50a3a
ci: tests should include coverage by default
phetw Dec 24, 2021
cb8f869
ci: bring back force build before test command
phetw Dec 24, 2021
2fff6b9
ci: add comment regarding Firefox test coverage
phetw Dec 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Setup Environment and Resources'
description: 'Setup environment, resources and caching'

outputs:
cache-dependencies-hit:
description: "Use dependencies cache"
value: ${{ steps.cache-npm.outputs.cache-hit }}
cache-build-hit:
description: "Use build output scripts cache"
value: ${{ steps.cache-build.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 15.x

- name: Setup caching dependencies
uses: actions/cache@v2
id: cache-npm
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}

- name: Setup caching build
uses: actions/cache@v2
id: cache-build
with:
path: |
packages/*/lib
packages/*-theme/**/*.js
packages/*-theme/**/*.css
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-${{ github.sha }}
31 changes: 0 additions & 31 deletions .github/workflows/lint.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ jobs:
git config --global user.name "refinitiv-ui-dev"

- name: Dependencies Installation
# Installing package dependencies strictly based on lock file
run: npm ci --ignore-scripts --audit=false --fund=false

- name: Build
# Builds only changed packages including its dependencies
- name: Production build
run: lerna run build:prod --include-dependencies --since

- name: Bump version and create GitHub release
Expand Down
61 changes: 51 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
branches: [develop]
jobs:
test-ubuntu:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
Expand All @@ -13,19 +13,60 @@ jobs:
# Pulls all commits (needed for Lerna)
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 15.x
cache: 'npm'
- name: Setup resources and environment
uses: ./.github/actions/setup
id: setup

- name: Dependencies Installtion
# Installing package dependencies strictly based on lock file
- name: Install Dependencies
if: steps.setup.outputs.cache-dependencies-hit != 'true'
run: npm ci --ignore-scripts --audit=false --fund=false

- name: Build
# Builds only changed packages including its dependencies
if: steps.setup.outputs.cache-build-hit != 'true'
run: lerna run build --include-dependencies --since origin/develop...HEAD

lint:
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup resources and environment
uses: ./.github/actions/setup

- name: Lint
run: lerna run lint --include-dependents --since origin/develop...HEAD

chrome:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup resources and environment
uses: ./.github/actions/setup

- name: Test
run: lerna run test --include-dependents --since origin/develop...HEAD -- -- --browsers chrome

firefox:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup resources and environment
uses: ./.github/actions/setup

- name: Test
run: lerna run test --include-dependents --since origin/develop...HEAD
# TODO: `@refinitiv/core` has test coverage below threshold on Firefox
run: lerna run test --include-dependents --since origin/develop...HEAD -- -- --browsers firefox --includeCoverage false
wsuwt marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"license": "Apache-2.0",
"scripts": {
"build": "tsc --sourceMap --declarationMap",
"build:watch": "npm run build -- --watch --preserveWatchOutput",
"build:prod": "tsc",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"scripts": {
"build": "tsc --sourceMap --declarationMap",
"build:watch": "npm run build -- --watch --preserveWatchOutput",
"build:prod": "tsc",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
1 change: 1 addition & 0 deletions packages/phrasebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
},
"scripts": {
"build": "tsc --sourceMap --declarationMap",
"build:watch": "npm run build -- --watch --preserveWatchOutput",
"build:prod": "tsc",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
1 change: 1 addition & 0 deletions packages/test-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"license": "Apache-2.0",
"scripts": {
"build": "tsc --sourceMap --declarationMap",
"build:watch": "npm run build -- --watch --preserveWatchOutput",
"build:prod": "tsc",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down