Skip to content

Commit

Permalink
Merge pull request NationalBankBelgium#2746 from SuperITMan/feature/c…
Browse files Browse the repository at this point in the history
…entralize-dependencies-in-root
  • Loading branch information
SuperITMan committed May 25, 2021
2 parents 0f05c34 + 4c7696e commit 9c0f640
Show file tree
Hide file tree
Showing 21 changed files with 5,789 additions and 16,159 deletions.
80 changes: 6 additions & 74 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/packages/stark-build"
directory: "/"
schedule:
interval: daily
time: "04:00"
Expand All @@ -13,86 +13,18 @@ updates:
- dependency-name: "@angular-builders/*"
versions:
- ">=8"
- dependency-name: "@angular-devkit/build-angular"
- dependency-name: "@angular-devkit/build-ng-packagr"
versions:
- ">=0.800"
commit-message:
prefix: chore
include: scope
- package-ecosystem: npm
directory: "/packages/stark-core"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "@types/node"
versions:
- ">=11"
- dependency-name: "@uirouter/angular"
versions:
- ">=6"
commit-message:
prefix: chore
include: scope
- package-ecosystem: npm
directory: "/packages/stark-rbac"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "@types/node"
versions:
- ">=11"
commit-message:
prefix: chore
include: scope
- package-ecosystem: npm
directory: "/packages/stark-testing"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "@types/node"
versions:
- ">=11"
commit-message:
prefix: chore
include: scope
- package-ecosystem: npm
directory: "/packages/stark-ui"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "@angular/*"
- dependency-name: "@angular-devkit/build-angular"
versions:
- ">=8"
- ">=0.800"
- dependency-name: "@mdi/angular-material"
versions:
- ">=5"
- dependency-name: "@types/node"
versions:
- ">=11"
commit-message:
prefix: chore
include: scope
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "@angular/*"
versions:
- ">=8"
- dependency-name: "@angular-devkit/build-ng-packagr"
- dependency-name: "@uirouter/angular"
versions:
- ">=0.800"
- ">=6"
- dependency-name: typescript
versions:
- ">= 0"
Expand Down
123 changes: 81 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [ "10", "12" ]
os: [ ubuntu-latest, macOS-latest ]
node_version: ["10", "12"]
os: [ubuntu-latest, macOS-latest]

steps:
# Some actions should be executed only in one environment.
Expand All @@ -39,7 +39,7 @@ jobs:
else
echo "IS_MAIN_ENVIRONMENT=0" >> $GITHUB_ENV
fi
# See: https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v2

Expand All @@ -63,20 +63,22 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install npm ${{ env.NPM_VERSION }}
run: npm i -g npm@${{ env.NPM_VERSION }}

- name: Get tag name if exists
run: |
TAG_NAME=$(echo $GITHUB_REF | sed -n "s/^refs\/tags\/\(\S*\).*$/\1/p")
echo "GH_ACTIONS_TAG=${TAG_NAME}" >> $GITHUB_ENV
- name: List main variables
run: |
echo "Commit SHA : ${GITHUB_SHA}"
echo "Tag name : ${{ env.GH_ACTIONS_TAG }}"
echo "Reference : ${GITHUB_REF}"
echo "Head branch : ${GITHUB_HEAD_REF}"
echo "Base branch : ${GITHUB_BASE_REF}"
echo "Build number: ${GITHUB_RUN_NUMBER}"
echo "Repository : ${GITHUB_REPOSITORY}"
echo "Event : ${GITHUB_EVENT_NAME}"
Expand All @@ -86,26 +88,27 @@ jobs:
echo "Node version: $NODE_VERSION"
# This ensures that we are authenticated without requiring to have an actual .npmrc file within the project
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: Check if dependencies are in sync between root and packages
run: "npm run check:packages-dependencies"

- name: Create file & folder for GitHub Actions logs
run: |
run: |
# cfr scripts/_ghactions-group.sh
mkdir -p ${{ env.LOGS_DIR }}
touch ${{ env.LOGS_FILE }}
- name: Install dependencies
run: |
npm ci
npm run install:ci:all
run: npm ci

- name: Linting
run: npm run lint:all
- name: Build packages
run: npm run build:trace

- name: Testing
run: npm run test:ci:all
- name: "Build showcase:ghpages"
run: npm run build:showcase:ghpages
- name: Linting packages
run: npm run lint:packages

- name: Testing packages
run: npm run test:ci:packages

# See: https://github.com/marketplace/actions/upload-artifact
- name: Upload stark packages-dist folder
Expand All @@ -115,14 +118,61 @@ jobs:
path: dist/packages-dist
if: env.IS_MAIN_ENVIRONMENT == 1

- name: Generate docs coverage
run: npm run docs:coverage:packages
if: env.IS_MAIN_ENVIRONMENT == 1

- name: Combine coveralls reports
run: node combine-packages-coverage.js
if: env.IS_MAIN_ENVIRONMENT == 1

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "combined-lcov.info"
if: env.IS_MAIN_ENVIRONMENT == 1

- name: Clean root node_modules
run: rm -rf ./node_modules

- name: Install starter
run: npm i
working-directory: starter

- name: "Install showcase with install command"
if: github.actor == 'nbb-bot' && startsWith(github.ref_head, 'dependabot/npm_and_yarn')
run: |
rm package-lock.json
npm install
working-directory: showcase

- name: "Install showcase with ci command"
if: github.actor != 'nbb-bot' || !startsWith(github.ref_head, 'dependabot/npm_and_yarn')
run: npm ci
working-directory: showcase

- name: Linting showcase & starter
run: |
npm run lint:showcase
npm run lint:starter
- name: Testing showcase & starter
run: |
npm run test:ci:showcase
npm run test:ci:starter
- name: "Build showcase:ghpages"
run: npm run build:showcase:ghpages

# See: https://github.com/marketplace/actions/upload-artifact
- name: Upload showcase dist folder
uses: actions/upload-artifact@v2
with:
name: showcase-dist
path: showcase/dist
if: env.IS_MAIN_ENVIRONMENT == 1

- name: BrowserStack Env Setup
uses: browserstack/github-actions/setup-env@master
with:
Expand All @@ -138,40 +188,29 @@ jobs:
local-logging-level: "all-logs"
local-identifier: "github-actions-${{ github.run_number }}"
if: env.IS_MAIN_ENVIRONMENT == 1 && github.event_name == 'push'

- name: Running application under test
run: npm run server:prod:ci &
if: env.IS_MAIN_ENVIRONMENT == 1 && github.event_name == 'push'
working-directory: showcase

- name: Running test on BrowserStack
run: npm run protractor:browserstack
if: env.IS_MAIN_ENVIRONMENT == 1 && github.event_name == 'push'
working-directory: showcase

- name: BrowserStackLocal Stop
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop
if: env.IS_MAIN_ENVIRONMENT == 1 && github.event_name == 'push'
- name: Generate docs coverage
run: npm run docs:coverage

- name: Generate starter docs coverage
run: npm run docs:starter:coverage
if: env.IS_MAIN_ENVIRONMENT == 1

- name: Save logs
run: bash ./scripts/ci/print-logs.sh

- name: Combine coveralls reports
run: node combine-packages-coverage.js
if: env.IS_MAIN_ENVIRONMENT == 1

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "combined-lcov.info"
if: env.IS_MAIN_ENVIRONMENT == 1

release:
name: Release
Expand All @@ -195,13 +234,13 @@ jobs:

- name: Install npm ${{ env.NPM_VERSION }}
run: npm i -g npm@${{ env.NPM_VERSION }}

- name: Create file & folder for GitHub Actions logs
run: |
# cfr scripts/_ghactions-group.sh
mkdir -p ${{ env.LOGS_DIR }}
touch ${{ env.LOGS_FILE }}
- uses: actions/download-artifact@v2
with:
name: stark-dist
Expand All @@ -220,14 +259,14 @@ jobs:
npm run install:ci:stark-rbac
npm run install:ci:stark-ui
if: github.event_name != 'schedule'

- name: Generate docs
run: npm run docs:publish -- --github-api-key=${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'schedule'

- name: Set npm token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc

- name: Release stark
run: npm run release:publish

Expand Down

0 comments on commit 9c0f640

Please sign in to comment.