diff --git a/.cz-config.js b/.cz-config.js
index ac8b3114c0..5440f4c0d5 100644
--- a/.cz-config.js
+++ b/.cz-config.js
@@ -22,17 +22,18 @@ module.exports = {
{ value: "test", name: "test: Adding missing tests or correcting existing tests" },
{
value: "build",
- name: "build: Changes that affect the build system or external dependencies (example scopes: rollup, npm)"
+ name: "build: Changes that affect the build system or external dependencies (example scopes: rollup, npm)"
},
{
value: "ci",
- name: "ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)"
+ name:
+ "ci: Changes to our CI configuration files and scripts (example scopes: GitHub Actions, Travis, Circle, BrowserStack, SauceLabs)"
},
{
value: "chore",
name: "chore: Changes to the build process or auxiliary tools and libraries such as documentation generation"
},
- { value: "revert", name: "revert: Reverts a previous commit" }
+ { value: "revert", name: "revert: Reverts a previous commit" }
],
scopes: generateScopes()
};
diff --git a/.editorconfig b/.editorconfig
index 02a5d40133..365a2df674 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -16,11 +16,7 @@ charset = utf-8
[*.bat]
end_of_line = crlf
-[{package.json,.travis.yml}]
-indent_style = space
-indent_size = 2
-
-[**.{css, pcss, scss,json,sh}]
+[**.{css, pcss, scss, json, sh, yml}]
indent_style = space
indent_size = 2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000000..433722ec77
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,222 @@
+name: ci
+
+on:
+ schedule:
+ - cron: "0 12 * * *"
+ push:
+ branches:
+ - master
+ - /^\d+\.\d+\.\d(-alpha\.\d+|-beta\.\d+|-rc\.\d+)?$/
+ tags:
+ - "*"
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build-test:
+ name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ node_version: ["10", "12"]
+ os: [ubuntu-latest, macOS-latest]
+ env:
+ LOGS_DIR: /tmp/stark/logs
+ LOGS_FILE: /tmp/stark/logs/build-perf.log
+ TZ: "Europe/Brussels"
+ steps:
+ - name: Set environment variable 'IS_MAIN_ENVIRONMENT'
+ run: |
+ if [[ '${{ matrix.node_version }}' == '10' ]] && [[ '${{ matrix.os }}' == 'ubuntu-latest' ]]; then
+ IS_MAIN_ENVIRONMENT=1
+ else
+ IS_MAIN_ENVIRONMENT=0
+ fi
+ echo "::set-env name=IS_MAIN_ENVIRONMENT::$(echo $IS_MAIN_ENVIRONMENT)"
+
+ # See: https://github.com/marketplace/actions/checkout
+ - uses: actions/checkout@v2
+
+ # See: https://github.com/marketplace/actions/setup-node-js-for-use-with-actions
+ - name: Use Node.js ${{ matrix.node_version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node_version }}
+
+ - name: Create file & folder for GitHub Actions logs
+ run: |
+ # cfr scripts/_ghactions-group.sh
+ mkdir -p $LOGS_DIR
+ touch $LOGS_FILE
+
+ - name: Install npm 6.9.2
+ run: npm i -g npm@6.9.2
+
+ - name: Get tag name if exists
+ id: get_tag_name
+ run: echo ::set-env name=GH_ACTIONS_TAG::$(echo $GITHUB_REF | sed -n "s/^refs\/tags\/\(\S*\).*$/\1/p")
+
+ - name: List main variables
+ run: |
+ echo "Commit SHA : ${GITHUB_SHA}"
+ echo "Reference : ${GITHUB_REF}"
+ echo "Repository : ${GITHUB_REPOSITORY}"
+ echo "Event : ${GITHUB_EVENT_NAME}"
+ echo "Author : ${GITHUB_ACTOR}"
+ echo "Main ENV : ${IS_MAIN_ENVIRONMENT}"
+ NODE_VERSION="$(node -v)"
+ 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
+
+ # See: https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
+ - name: Cache node modules
+ uses: actions/cache@v1
+ env:
+ cache-name: cache-node-modules
+ with:
+ path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Install dependencies
+ run: |
+ npm ci
+ npm run install:ci:all
+
+ # See: https://github.com/marketplace/actions/upload-artifact
+ - uses: actions/upload-artifact@v1
+ with:
+ name: stark-dist
+ path: dist/packages-dist
+ if: env.IS_MAIN_ENVIRONMENT == 1
+
+ - name: Linting and testing
+ run: |
+ npm run lint:all
+ npm run test:ci:all
+
+ - name: "Build showcase:ghpages"
+ run: npm run build:showcase:ghpages
+
+ - uses: actions/upload-artifact@v1
+ with:
+ name: showcase-dist
+ path: showcase/dist
+ if: env.IS_MAIN_ENVIRONMENT == 1
+
+ - name: Browserstack testing
+ run: |
+ #npm run test:showcase:e2e:browserstack
+ env:
+ BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
+ BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
+ if: env.IS_MAIN_ENVIRONMENT == 1
+
+ - name: Generate docs coverage
+ run: npm run docs: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
+ runs-on: "ubuntu-latest"
+ needs: build-test
+ if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'schedule'
+ env:
+ LOGS_DIR: /tmp/ngx-form-errors/logs
+ LOGS_FILE: /tmp/ngx-form-errors/logs/build-perf.log
+ TZ: "Europe/Brussels"
+ steps:
+ - name: Get tag name if exists
+ id: get_tag_name
+ run: echo ::set-env name=GH_ACTIONS_TAG::$(echo $GITHUB_REF | sed -n "s/^refs\/tags\/\(\S*\).*$/\1/p")
+
+ # See: https://github.com/marketplace/actions/checkout
+ - uses: actions/checkout@v2
+
+ # See: https://github.com/marketplace/actions/setup-node-js-for-use-with-actions
+ - name: Use Node.js 10
+ uses: actions/setup-node@v1
+ with:
+ node-version: "10"
+
+ - name: Install npm 6.9.2
+ run: npm i -g npm@6.9.2
+
+ - uses: actions/download-artifact@v1
+ with:
+ name: stark-dist
+ path: dist/packages-dist
+
+ - uses: actions/download-artifact@v1
+ with:
+ name: showcase-dist
+ path: showcase/dist
+
+ # See: https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
+ - name: Cache node modules
+ uses: actions/cache@v1
+ env:
+ cache-name: cache-node-modules
+ with:
+ path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Install Stark packages dependencies
+ run: |
+ npm ci
+ npm run install:ci:stark-build
+ npm run install:ci:stark-core
+ npm run install:ci:stark-rbac
+ npm run install:ci:stark-ui
+ if: github.event_name != 'schedule'
+
+ - name: Create file & folder for GitHub Actions logs
+ run: |
+ # cfr scripts/_ghactions-group.sh
+ mkdir -p $LOGS_DIR
+ touch $LOGS_FILE
+
+ - name: Generate docs
+ run: npm run docs:publish
+ env:
+ GH_ACTIONS_JOB_STATUS: ${{ job.status }}
+ if: github.event_name != 'schedule'
+
+ - name: Push docs & showcase on gh-pages
+ uses: ad-m/github-push-action@master
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ directory: ".tmp/ghpages"
+ branch: "gp-pages"
+ if: github.event_name != 'schedule'
+
+ - name: Release stark
+ run: npm run release:publish
+ env:
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ - name: Save logs
+ run: bash ./scripts/ci/print-logs.sh
diff --git a/.gitignore b/.gitignore
index bf50967a93..deb9d2b4a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
# Build
dist/
+/dist/
.awcache/
-dist/
.tmp/
/.tmp/
tmp/
diff --git a/.travis.yml b/.travis.yml
index cb9c5471c2..e69de29bb2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,62 +0,0 @@
-language: node_js
-node_js:
- - "10"
- - "12"
-
-dist: trusty
-sudo: false # better for performance
-
-before_install:
- - echo $TRAVIS_COMMIT
- - echo $TRAVIS_TAG
- - echo $TRAVIS_BRANCH
- - echo $TRAVIS_BUILD_NUMBER
- - echo $TRAVIS_REPO
- - export TZ=Europe/Brussels
- - npm i -g npm@6.9.2
- - NODE_VERSION="$(node -v)"
- - echo $NODE_VERSION
- # This ensures that we are authenticated without requiring to have an actual .npmrc file within the project
- - 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc'
-
-install:
- # Create file & folder for Travis logs
- # cfr scripts/_travis-fold.sh
- - mkdir -p $LOGS_DIR
- - touch $LOGS_DIR/build-perf.log
- - npm ci
- - npm run install:ci:all
- - npm run build:showcase:ghpages
-
-env:
- global:
- - LOGS_DIR=/tmp/stark/logs
- - LOGS_FILE=/tmp/stark/logs/build-perf.log
-
-branches:
- only:
- - master
- - /^dependabot/npm_and_yarn/.*$/
- - /^\d+\.\d+\.\d(-alpha\.\d+|-beta\.\d+|-rc\.\d+)?$/
-
-cache:
- directories:
- - $HOME/.npm
-
-# Not needed since we use Puppeteer in karma.conf.ci.js
-# It downloads Chrome itself and works with or without Travis
-# chrome: stable
-
-script:
- - npm run lint:all
- - npm run test:ci:all
- # E2E tests only need to be run on 1 node version (v10)
- # and the secure environmentals BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY should be set. (only on secure builds)
- - if [[ ${NODE_VERSION} =~ ^v10.*$ && -n "${BROWSERSTACK_USERNAME}" && -n "${BROWSERSTACK_ACCESS_KEY}" ]]; then npm run test:showcase:e2e:browserstack; else echo "Skipping browserstack tests."; fi
- - npm run docs:coverage
- - npm run docs:publish
- - npm run release:publish
- - bash ./scripts/ci/print-logs.sh
-
-after_success:
- - npm run test:ci:coveralls:combined
diff --git a/README.md b/README.md
index c303f2ef51..6cf351dc20 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-core.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-core)
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-core.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-core)
-[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark)
+[![Build Status](https://github.com/NationalBankBelgium/stark/workflows/ci/badge.svg)](https://github.com/NationalBankBelgium/stark/actions?query=workflow%3Aci)
[![Coverage Status](https://coveralls.io/repos/github/NationalBankBelgium/stark/badge.svg?branch=master)](https://coveralls.io/github/NationalBankBelgium/stark?branch=master)
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark.svg)](https://david-dm.org/NationalBankBelgium/stark)
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark#info=devDependencies)
@@ -144,11 +144,11 @@ We're supported by [Jetbrains](https://www.jetbrains.com) and their awesome [sup
-### Travis
+### GitHub Actions
-We're supported by [Travis](https://travis-ci.org/)
+We're supported by [GitHub Actions](https://github.com/features/actions)
-
+
### BrowserStack
diff --git a/RELEASE.md b/RELEASE.md
index 2f50b001c3..f39f262759 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -7,9 +7,9 @@
On your local machine, you must configure the `GITHUB_TOKEN` environment variable.
It will be used by release-it to push to and create the release page on GitHub (cfr [What happens once a release is triggered](#release-process) section below).
-### Travis
+### GitHub Actions
-On Travis, the following should be configured:
+On GitHub, the following should be configured:
- NPM_TOKEN environment variable
- if 2FA is enabled for the account the only auth-only level can be used: https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication
@@ -38,7 +38,7 @@ _NOTE:_ If any of the pre-conditions mentioned above are not met, no worries, th
## Publishing the release on npm
-Once you have pushed the tag, Travis will handle things from there.
+Once you have pushed the tag, GitHub Actions will handle things from there.
Once done, you must make sure that the distribution tags are adapted so that the `latest` tag still points to what we consider the latest (i.e., next major/minor)!
Refer to the "Adapting tags of published packages" section below.
@@ -63,9 +63,9 @@ After this, the release is tagged and visible on github
#### What
-Once the tag is pushed to GitHub, Travis picks it up and initiates a build.
+Once the tag is pushed to GitHub, GitHub Actions picks it up and initiates a build.
-Travis executes builds, tests, then executes `npm run docs:publish`.
+GitHub Actions executes builds, tests, then executes `npm run docs:publish`.
That script makes some checks then, if all succeed it publishes the API docs of the different packages as well as the production build output of the showcase to Github pages.
@@ -74,63 +74,30 @@ That script makes some checks then, if all succeed it publishes the API docs of
Checks that are performed:
- node version: should be "10"
-- TRAVIS_REPO_SLUG should be "NationalBankBelgium/stark"
-- TRAVIS_TAG should be defined and not empty (this is the case when Travis builds for a tag)
-- TRAVIS_PULL_REQUEST should be false
-- TRAVIS_BRANCH should be "master"
-- TRAVIS_EVENT_TYPE should be "cron" (i.e., not a nightly build or manual build)
-- encrypted\_... environment should be available (those have been created by encrypting our SSH key; cfr below!)
+- GITHUB_REPOSITORY should be "NationalBankBelgium/stark"
+- GH_ACTIONS_TAG should be defined and not empty (this is the case when GitHub Actions builds for a tag)
+- GITHUB_REF should be "refs/heads/master"
+- GITHUB_EVENT_NAME should be "schedule" (i.e., not a nightly build or manual build)
More details here: https://github.com/NationalBankBelgium/stark/issues/282
#### Security
-The docs publication uses an SSH key that has write access to the Stark repository.
-That key is available in the source code in encrypted form in the `stark-ssh` file.
-That file actually corresponds to the private key of an SSH key-pair encrypted using the Travis CLI (details below).
-
-#### Replacing the GitHub credentials (SSH key)
-
-To replace the keys used by the docs publish script:
-
-- create a new SSH key pair: `ssh-keygen -t rsa -b 4096 -C "..."`
- - call it `stark-ssh` for safety: that name is in the .gitignore list
-- associate the public key with the Stark repository as a "Deploy Key": https://developer.github.com/v3/guides/managing-deploy-keys/
-- encrypt the private key with the Travis CLI: `travis encrypt-file ./stark-ssh -r NationalBankBelgium/stark`
- - that command will generate an encrypted version of the key
- - make sure you're logged in (see [Installing the Travis CLI](#intalling-travis-cli) section)
- - **IMPORTANT: on Windows the generation of the encrypted key produces a corrupted file. So you should generate it on a Linux system. See https://github.com/travis-ci/travis-ci/issues/4746**
-- save the encrypted file as `stark-ssh.enc` and get rid of the non-encrypted key directly
-
-The command will also
-
-- store the (randomly generated) encryption key and initialization vector as (secure) Travis environment variables
-- provide the openssl command to use in the scripts to decrypt the stark-ssh.enc file; for example: `openssl aes-256-cbc -K $encrypted_e546efaa49e5_key -iv $encrypted_e546efaa49e5_iv -in stark-ssh.enc -out ./stark-ssh -d`.
-
-The name of those variables will change each time it is used, therefore the `gh-deploy.sh` MUST also be adapted afterwards.
-
-#### Installing the Travis CLI
-
-Steps:
-
-- Install Ruby to get the `gem` command
-- Install Travis CLI with gem install travis
-- Login to Travis using GH credentials: travis login --org --github-token yourtoken
- - `Successfully logged in as ...`
-- Have fun!
+The push of the modified docs (new commit) is done thanks to `github-push-action` in the GitHub Actions job.
+It simply uses the `{{ secrets.GITHUB_TOKEN }}` provided by GitHub in GitHub Actions.
### npm packages publish
-Finally, Travis executes `npm run release:publish`.
+Finally, GitHub Actions executes `npm run release:publish`.
-That script makes some checks then, if all succeed, it publishes the different packages on npm and sets the `last` and `next` distribution tags to the published version.
+That script makes some checks then, if all succeed, it publishes the different packages on npm and sets the `latest` and `next` distribution tags to the published version.
Checks that are performed:
- node version: should be "10"
- NPM_TOKEN environment variable should be defined
-- TRAVIS_REPO_SLUG should be "NationalBankBelgium/stark"
-- TRAVIS_TAG should be defined and not empty (this is the case when Travis builds for a tag)
+- GITHUB_REPOSITORY should be "NationalBankBelgium/stark"
+- GH_ACTIONS_TAG should be defined and not empty (this is the case when GitHub Actions builds for a tag)
Other details can be found here: https://github.com/NationalBankBelgium/stark/issues/54
diff --git a/SNAPSHOTS.md b/SNAPSHOTS.md
index 565124407b..52d34c4312 100644
--- a/SNAPSHOTS.md
+++ b/SNAPSHOTS.md
@@ -1,6 +1,6 @@
# Stark Snapshots
-Daily snapshot builds are created and published by a Travis cron job.
+Daily snapshot builds are created and published by a GitHub Actions scheduled job.
This was introduced via [this issue](https://github.com/NationalBankBelgium/stark/issues/27).
-For details, refer to `.travis.yml` and `release-publish.sh`
+For details, refer to `.github/workflows/build.yml` and `release-publish.sh`
diff --git a/build.sh b/build.sh
index c4802aa615..be6fbd4f9d 100644
--- a/build.sh
+++ b/build.sh
@@ -12,7 +12,7 @@ readonly currentDir=$(cd $(dirname $0); pwd)
export NODE_PATH=${NODE_PATH:-}:${currentDir}/node_modules
-source ${currentDir}/scripts/ci/_travis-fold.sh
+source ${currentDir}/scripts/ci/_ghactions-group.sh
source ${currentDir}/util-functions.sh
source ${currentDir}/build-functions.sh
@@ -38,7 +38,9 @@ BUILD_ALL=true
BUNDLE=true
COMPILE_SOURCE=true
-TRAVIS=${TRAVIS:-}
+GITHUB_ACTIONS=${GITHUB_ACTIONS:-}
+GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME:-""}
+GH_ACTIONS_TAG=${GH_ACTIONS_TAG:-""}
VERBOSE=false
TRACE=false
@@ -133,25 +135,15 @@ logTrace "ROOT_DIR: ${ROOT_DIR}" 1
ROOT_OUT_DIR=${PROJECT_ROOT_DIR}/dist/packages
logTrace "ROOT_OUT_DIR: ${ROOT_OUT_DIR}" 1
-# Making sure the variable exists
-if [[ -z ${TRAVIS_TAG+x} ]]; then
- TRAVIS_TAG=""
-fi
-
-# Making sure the variable exists
-if [[ -z ${TRAVIS_EVENT_TYPE+x} ]]; then
- TRAVIS_EVENT_TYPE=""
-fi
-
-if [[ ${TRAVIS_EVENT_TYPE} == "cron" ]]; then
- logInfo "Nightly build initiated by Travis cron job. Using nightly version as version prefix!" 1
+if [[ ${GITHUB_EVENT_NAME} == "schedule" ]]; then
+ logInfo "Nightly build initiated by GitHub Actions scheduled job. Using nightly version as version prefix!" 1
VERSION_PREFIX=$(node -p "require('./package.json').config.nightlyVersion")
else
logInfo "Normal build. Using current version as version prefix" 1
VERSION_PREFIX=$(node -p "require('./package.json').version")
fi
-if [[ ${TRAVIS_TAG} == "" ]]; then
+if [[ ${GH_ACTIONS_TAG} == "" ]]; then
logTrace "Setting the version suffix to the latest commit hash" 1
VERSION_SUFFIX="-$(git log --oneline -1 | awk '{print $1}')" # last commit id
else
@@ -175,9 +167,9 @@ logInfo "============================================="
NG=`pwd`/node_modules/.bin/ng
if [[ ${BUILD_ALL} == true ]]; then
- travisFoldStart "clean dist" "no-xtrace"
+ ghActionsGroupStart "clean dist" "no-xtrace"
rm -rf ./dist/packages
- travisFoldEnd "clean dist"
+ ghActionsGroupEnd "clean dist"
fi
if [[ ${BUILD_ALL} == true ]]; then
@@ -192,7 +184,7 @@ fi
if [[ ${BUILD_ALL} == false ]]; then
for PACKAGE in ${ALL_PACKAGES[@]}
do
- travisFoldStart "clean dist for ${PACKAGE}" "no-xtrace"
+ ghActionsGroupStart "clean dist for ${PACKAGE}" "no-xtrace"
rm -rf ./dist/packages/${PACKAGE}
if [[ ${BUNDLE} == true ]]; then
rm -rf ./dist/packages-dist/${PACKAGE}
@@ -206,14 +198,14 @@ if [[ ${BUILD_ALL} == false ]]; then
mkdir -p ./dist/packages-dist
fi
done
- travisFoldEnd "clean dist for ${PACKAGE}"
+ ghActionsGroupEnd "clean dist for ${PACKAGE}"
fi
mkdir -p ${ROOT_OUT_DIR}
for PACKAGE in ${ALL_PACKAGES[@]}
do
- travisFoldStart "global build: ${PACKAGE}" "no-xtrace"
+ ghActionsGroupStart "global build: ${PACKAGE}" "no-xtrace"
SRC_DIR=${ROOT_DIR}/${PACKAGE}
logTrace "SRC_DIR: $SRC_DIR" 1
OUT_DIR=${ROOT_OUT_DIR}/${PACKAGE}
@@ -224,7 +216,7 @@ do
LICENSE_BANNER=${ROOT_DIR}/license-banner.txt
if [[ ${#PACKAGES[@]} > 0 && $(containsElement "${PACKAGE}" "${PACKAGES[@]}"; echo $?) == 0 ]]; then
- travisFoldStart "build package: ${PACKAGE}" "no-xtrace"
+ ghActionsGroupStart "build package: ${PACKAGE}" "no-xtrace"
rm -rf ${OUT_DIR}
rm -f ${ROOT_OUT_DIR}/${PACKAGE}.js
@@ -266,11 +258,11 @@ do
addBanners ${FESM5_DIR}
addBanners ${BUNDLES_DIR}
- travisFoldEnd "build package: ${PACKAGE}"
+ ghActionsGroupEnd "build package: ${PACKAGE}"
fi
if [[ ${#NODE_PACKAGES[@]} > 0 && $(containsElement "${PACKAGE}" "${NODE_PACKAGES[@]}"; echo $?) == 0 ]]; then
- travisFoldStart "build node package: ${PACKAGE}" "no-xtrace"
+ ghActionsGroupStart "build node package: ${PACKAGE}" "no-xtrace"
# contents only need to be copied to the destination folder
logInfo "Copy ${PACKAGE} to ${OUT_DIR}"
@@ -281,10 +273,10 @@ do
logInfo "Copy $PACKAGE contents"
syncFiles ${OUT_DIR} ${NPM_DIR} "-a"
- travisFoldEnd "build node package: ${PACKAGE}"
+ ghActionsGroupEnd "build node package: ${PACKAGE}"
fi
- travisFoldStart "general tasks: ${PACKAGE}" "no-xtrace"
+ ghActionsGroupStart "general tasks: ${PACKAGE}" "no-xtrace"
if [[ -d ${NPM_DIR} ]]; then
logInfo "Copy $PACKAGE README.md file to $NPM_DIR"
cp ${ROOT_DIR}/README.md ${NPM_DIR}/
@@ -310,10 +302,10 @@ do
adaptNpmPackageLockDependencies ${PACKAGE} ${VERSION} "./starter/package-lock.json" 1
fi
- travisFoldEnd "general tasks: ${PACKAGE}"
+ ghActionsGroupEnd "general tasks: ${PACKAGE}"
- travisFoldEnd "global build: ${PACKAGE}"
+ ghActionsGroupEnd "global build: ${PACKAGE}"
done
# Print return arrows as a log separator
-travisFoldReturnArrows
+ghActionsGroupReturnArrows
diff --git a/combine-packages-coverage.js b/combine-packages-coverage.js
index a17e2a4a94..3e534e26c7 100644
--- a/combine-packages-coverage.js
+++ b/combine-packages-coverage.js
@@ -21,5 +21,6 @@ const nextStream = function() {
};
const combinedStream = new StreamConcat(nextStream);
+const combinedLcovFileName = fs.createWriteStream('combined-lcov.info');
-combinedStream.pipe(process.stdout);
+combinedStream.pipe(combinedLcovFileName);
diff --git a/docs/E2E_TESTING.md b/docs/E2E_TESTING.md
index 768646dab2..1b85e99e50 100644
--- a/docs/E2E_TESTING.md
+++ b/docs/E2E_TESTING.md
@@ -37,7 +37,7 @@ Keeping e2e tests separate like this prevents confusion when testing multiple co
## BrowserStack (optional)
-The showcase app uses Travis CI and BrowserStack to automatically run e2e-tests on multiple setups (Chrome, Firefox, IE, Safari, Android, IOS, ...).
+The showcase app uses GitHub Actions CI and BrowserStack to automatically run e2e-tests on multiple setups (Chrome, Firefox, IE, Safari, Android, IOS, ...).
If you want to run your e2e-tests automatically on multiple setups one of the easiest solutions is BrowserStack.
They offer a free solution for open source projects.
@@ -69,9 +69,9 @@ _For more documentation see:_
- _[https://github.com/angular/protractor/blob/master/lib/config.ts](https://github.com/angular/protractor/blob/master/lib/config.ts)_
- _[https://www.browserstack.com/automate/capabilities](https://www.browserstack.com/automate/capabilities)_
-### Integrating BrowserStack with Travis CI
+### Integrating BrowserStack with GitHub Actions CI
-To integrate the BrowserStack testing with Travis-CI simply add the same environmentals as before. **Remember to keep them private.**
+To integrate the BrowserStack testing with GitHub Actions CI simply add the same environmentals as before. **Remember to keep them private.**
### Common errors
diff --git a/gh-deploy.sh b/gh-deploy.sh
index 871a481fe0..df1d5e9cba 100644
--- a/gh-deploy.sh
+++ b/gh-deploy.sh
@@ -4,8 +4,7 @@
#===================
# provide a clean way to define/check the "current" version of node (i.e., the one we should execute the publish under/for)
## ideally we should read it from .nvmrc
-# for local deployment, instead of using stark-ssh.enc, we should use the GITHUB_API_KEY key passed via --github-api-key=foo
-## if present then we could push directly without handling decryption, etc
+# for local deployment, instead of using `github-push-action`, we should use the GITHUB_API_KEY key passed via --github-api-key=foo
set -u -e -o pipefail
@@ -16,16 +15,13 @@ ENFORCE_SHOWCASE_VERSION_CHECK=true
TARGET_BRANCH="gh-pages"
COMMIT_HASH=`git rev-parse --verify HEAD`
-TARGET_REPO="git@github.com:NationalBankBelgium/stark.git"
+TARGET_REPO="https://github.com/NationalBankBelgium/stark.git"
EXPECTED_REPO_SLUG="NationalBankBelgium/stark"
-EXPECTED_NODE_VERSION="10"
+GH_ACTIONS_TAG=${GH_ACTIONS_TAG:-""}
-COMMIT_AUTHOR_USERNAME="TravisCI"
+COMMIT_AUTHOR_USERNAME="GitHub Actions CI"
COMMIT_AUTHOR_EMAIL="alexis.georges@nbb.be"
-SSH_KEY_ENCRYPTED="stark-ssh.enc"
-SSH_KEY_CLEARTEXT_FILE="stark-ssh"
-
STARK_CORE="stark-core"
STARK_UI="stark-ui"
STARK_RBAC="stark-rbac"
@@ -40,38 +36,23 @@ LATEST_DIR_NAME="latest"
#mkdir -p ${LOGS_DIR}
#touch ${LOGS_DIR}/build-perf.log
#DRY_RUN=true
-#TRAVIS=true
-#TRAVIS_NODE_VERSION="10"
-#TRAVIS_COMMIT=${COMMIT_HASH}
-#TRAVIS_REPO_SLUG="NationalBankBelgium/stark" # yes we're always on the correct repo
+#GITHUB_ACTIONS=true
+#GITHUB_SHA=${COMMIT_HASH}
+#GITHUB_REPOSITORY="NationalBankBelgium/stark" # yes we're always on the correct repo
#ENFORCE_SHOWCASE_VERSION_CHECK=false # allows not have consistency between tag version and showcase version
-#encrypted_084795922354_iv="foo" # variable needed for the decryption of the SSH private key
-#encrypted_084795922354_key="bar" # variable needed for the decryption of the SSH private key
# Point to a fork or any other repo
-#TARGET_REPO="git@github.com:superitman/stark.git"
+#TARGET_REPO="https://github.com/superitman/stark.git"
# Avoid messing up Git config (even though limited to the current repo)
#COMMIT_AUTHOR_USERNAME="Alexis Georges"
#COMMIT_AUTHOR_EMAIL="alexis.georges@nbb.be"
-# For PRs (NOT accepted)
-#TRAVIS_EVENT_TYPE="pull_request"
-
-# For nightly builds (NOT accepted)
-#TRAVIS_PULL_REQUEST="false"
-#TRAVIS_EVENT_TYPE="cron"
-
-# For releases
-#TRAVIS_PULL_REQUEST="false"
-#TRAVIS_TAG="barFoo"
-#TRAVIS_EVENT_TYPE="push"
-
#----------------------------------------------
readonly currentDir=$(cd $(dirname $0); pwd)
-source ${currentDir}/scripts/ci/_travis-fold.sh
+source ${currentDir}/scripts/ci/_ghactions-group.sh
source ${currentDir}/util-functions.sh
cd ${currentDir}
@@ -129,111 +110,45 @@ rm -rf ${DOCS_WORK_DIR}
mkdir -p ${DOCS_WORK_DIR}
-travisFoldStart "docs publication checks" "no-xtrace"
+ghActionsGroupStart "docs publication checks" "no-xtrace"
-if [[ ${TRAVIS} == true ]]; then
+if [[ ${GITHUB_ACTIONS} == true ]]; then
logInfo "Publishing docs to GH pages";
logInfo "============================================="
# Don't even try if not running against the official repo
# We don't want docs publish to run outside of our own little world
- if [[ ${TRAVIS_REPO_SLUG} != ${EXPECTED_REPO_SLUG} ]]; then
+ if [[ ${GITHUB_REPOSITORY} != ${EXPECTED_REPO_SLUG} ]]; then
logInfo "Skipping release because this is not the main repository.";
exit 0;
fi
-
- # Ensuring that this is the execution for Node x
- # Without this check, we would publish a release for each node version we test under! :)
- if [[ ${TRAVIS_NODE_VERSION} != ${EXPECTED_NODE_VERSION} ]]; then
- logInfo "Skipping release because this is not the expected version of node: ${TRAVIS_NODE_VERSION}"
- exit 0;
- fi
-
- logInfo "Verifying if this build has been triggered for a tag"
- # Making sure the variables exist..
- if [[ -z ${TRAVIS_TAG+x} ]]; then
- TRAVIS_TAG=""
- fi
-
- if [[ -z ${TRAVIS_PULL_REQUEST+x} ]]; then
- TRAVIS_PULL_REQUEST=""
- fi
-
- if [[ ${TRAVIS_PULL_REQUEST} != "false" ]]; then
- logInfo "Not publishing because this is a build triggered for a pull request" 1
- exit 0;
- fi
-
- if [[ ${TRAVIS_EVENT_TYPE} == "cron" ]]; then
- logInfo "Not publishing because this is a build triggered for a nightly build" 1
- exit 0;
- fi
-
- if [[ ${TRAVIS_TAG} == "" ]]; then
- logInfo "Not publishing because this is not a build triggered for a tag" 1
- exit 0;
- else
- logInfo "OK, this build has been triggered for a tag"
- fi
-
- # Those keys are needed to decrypt the ${SSH_KEY_ENCRYPTED} file, which contains the SSH private key
- # that we'll use to push to GitHub pages!
- logInfo "Verifying that the necessary decryption keys are available"
- if [[ -z ${encrypted_084795922354_iv+x} ]]; then
- encrypted_084795922354_iv=""
- fi
- if [[ -z ${encrypted_084795922354_key+x} ]]; then
- encrypted_084795922354_key=""
- fi
-
- if [[ ${encrypted_084795922354_iv} == "" ]]; then
- logInfo "Not publishing because the SSH key decryption IV is not available as environment variable" 1
- exit 0;
- else
- logTrace "SSH key decryption IV is available" 2
- ENCRYPTED_IV=${encrypted_084795922354_iv}
- fi
-
- if [[ ${encrypted_084795922354_key} == "" ]]; then
- logInfo "Not publishing because the SSH key decryption key is not available as environment variable" 1
- exit 0;
- else
- logTrace "SSH key decryption key is available" 2
- ENCRYPTED_KEY=${encrypted_084795922354_key}
- fi
-
- # If any of the previous commands in the `script` section of .travis.yaml failed, then abort.
- # The variable is not set in early stages of the build, so we default to 0 there.
- # https://docs.travis-ci.com/user/environment-variables/
- if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
- logInfo "Skipping docs publication because a previous script in the Travis build has failed" 1
- exit 0;
- fi
else
- logInfo "Not publishing because we are not in Travis. Currently that is the only supported option!"
+ logInfo "Not publishing because we are not in GitHub Actions. Currently that is the only supported option!"
exit 0
fi
-travisFoldEnd "docs publication checks"
+ghActionsGroupEnd "docs publication checks"
-travisFoldStart "docs generation" "no-xtrace"
+ghActionsGroupStart "docs generation" "no-xtrace"
logInfo "Generating API docs"
-npm run docs:all
+npm run docs:stark-core:generate
+npm run docs:stark-rbac:generate
+npm run docs:stark-ui:generate
logTrace "API docs generated successfully" 1
-travisFoldEnd "docs generation" "no-xtrace"
+ghActionsGroupEnd "docs generation" "no-xtrace"
-travisFoldStart "docs publication" "no-xtrace"
+ghActionsGroupStart "docs publication" "no-xtrace"
logInfo "Publishing API docs"
logTrace "Determining target folders for api docs" 1
-DOCS_VERSION=${TRAVIS_TAG}
+DOCS_VERSION=${GH_ACTIONS_TAG}
SHOWCASE_PACKAGE_VERSION=$(node -p "require('./package.json').version")
#alternative (faster but less safe): SHOWCASE_PACKAGE_VERSION=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)
@@ -247,39 +162,8 @@ fi
logTrace "Version for which we are producing docs: ${DOCS_VERSION}"
-if [[ ${TRAVIS} == true ]]; then
- logTrace "Configuring Git for Travis"
- git config user.name ${COMMIT_AUTHOR_USERNAME}
- git config user.email ${COMMIT_AUTHOR_EMAIL}
-fi
-
logTrace "Cloning stark's github pages branch to ${DOCS_WORK_DIR}"
-if [[ ${DRY_RUN} == false ]]; then
- logTrace "Decrypting the SSH private key"
- openssl aes-256-cbc -K ${ENCRYPTED_KEY} -iv ${ENCRYPTED_IV} -in ./${SSH_KEY_ENCRYPTED} -out ./${SSH_KEY_CLEARTEXT_FILE} -d
- chmod 600 ./${SSH_KEY_CLEARTEXT_FILE}
- logTrace "Decrypted the SSH private key"
-
- # to test the connection with GitHub using the decrypted key
- # logTrace "Hi github.com!"
- # ssh -T git@github.com -i ./${SSH_KEY_CLEARTEXT_FILE}
-
- # we use our decrypted private SSH key
- logTrace "Setting SSH config"
- mv -f ./${SSH_KEY_CLEARTEXT_FILE} ~/.ssh
- mv -f ./ssh-config ~/.ssh/config
- logTrace "SSH config set"
-
- # these alternatives did not work
- # alias git="GIT_SSH_COMMAND='ssh -i ./${SSH_KEY_CLEARTEXT_FILE}' git"
- # git config core.sshCommand "ssh -i ./${SSH_KEY_CLEARTEXT_FILE}"
-
- # possible alternative:
- #eval `ssh-agent -s`
- #ssh-add ./${SSH_KEY_CLEARTEXT_FILE}
-fi
-
git clone --quiet --depth=1 --branch=${TARGET_BRANCH} ${TARGET_REPO} ${DOCS_WORK_DIR}
API_DOCS_TARGET_DIR_STARK_CORE=${DOCS_WORK_DIR}/${API_DOCS_DIR_NAME}/${STARK_CORE}/${DOCS_VERSION}
@@ -334,20 +218,19 @@ unset syncOptions
logInfo "Pushing the docs to GitHub pages"
cd ${DOCS_WORK_DIR}
+
+logTrace "Configuring Git for GitHub Actions"
+git config user.name ${COMMIT_AUTHOR_USERNAME}
+git config user.email ${COMMIT_AUTHOR_EMAIL}
+
git add -A &> /dev/null # way too long
git commit --quiet -m "Publishing docs for version: ${DOCS_VERSION}"
-git push --quiet --force
-cd - > /dev/null
-# TODO: if a GITHUB_API_KEY was passed, then we should use it
-#if [[ ${GITHUB_API_KEY} != "" ]]; then
-# logTrace "Using the provided GITHUB API KEY to push" 1
-# exit 0;
-#fi
+cd - > /dev/null
-logInfo "Documentation published successfully!"
+logInfo "Documentation will be published right after by the 'ad-m/github-push-action@master' GitHub Action"
-travisFoldEnd "docs publication"
+ghActionsGroupEnd "docs publication"
# Print return arrows as a log separator
-travisFoldReturnArrows
+ghActionsGroupReturnArrows
diff --git a/package.json b/package.json
index 4fa1111e64..f804310f1c 100644
--- a/package.json
+++ b/package.json
@@ -134,7 +134,6 @@
"install:ci:stark-testing": "cd packages/stark-testing && npm ci && cd ../..",
"install:ci:stark-ui": "cd packages/stark-ui && npm ci && cd ../..",
"install:ci:showcase": "cd showcase && npm ci && cd ..",
- "install:travis:all": "npm run install:stark-build && npm run install:stark-testing && npm run install:stark-core && npm run install:stark-ui && npm run install:stark-rbac && npm run build:trace && npm run update:starter && npm run update:showcase",
"ng": "ng",
"ngc": "ngc",
"prettier-check": "prettier \"**/*.{css,html,js,json,md,pcss,scss,ts,yml}\" --write --html-whitespace-sensitivity strict",
@@ -171,7 +170,6 @@
"test:ci:stark-ui": "cd packages/stark-ui && npm run test-fast:ci && cd ../..",
"test:ci:showcase": "cd showcase && npm run test-fast:ci && cd ../..",
"test:ci:starter": "cd starter && npm run test-fast:ci && cd ../..",
- "test:ci:coveralls:combined": "node combine-packages-coverage.js | packages/stark-testing/node_modules/coveralls/bin/coveralls.js",
"tsc": "tsc",
"tslint": "tslint",
"tslint-check": "tslint-config-prettier-check ./tslint.json",
diff --git a/packages/stark-build/README.md b/packages/stark-build/README.md
index f45bb77013..800f70c108 100644
--- a/packages/stark-build/README.md
+++ b/packages/stark-build/README.md
@@ -1,6 +1,6 @@
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-build.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-build)
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-build.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-build)
-[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark)
+[![Build Status](https://github.com/NationalBankBelgium/stark/workflows/ci/badge.svg)](https://github.com/NationalBankBelgium/stark/actions?query=workflow%3Aci)
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark-build.svg)](https://david-dm.org/NationalBankBelgium/stark-build)
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark-build/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark-build#info=devDependencies)
[![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE)
diff --git a/packages/stark-core/README.md b/packages/stark-core/README.md
index 8cf25d1bda..cb13c731c8 100644
--- a/packages/stark-core/README.md
+++ b/packages/stark-core/README.md
@@ -1,6 +1,6 @@
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-core.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-core)
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-core.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-core)
-[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark)
+[![Build Status](https://github.com/NationalBankBelgium/stark/workflows/ci/badge.svg)](https://github.com/NationalBankBelgium/stark/actions?query=workflow%3Aci)
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark-core.svg)](https://david-dm.org/NationalBankBelgium/stark-core)
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark-core/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark-core#info=devDependencies)
[![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE)
diff --git a/packages/stark-rbac/README.md b/packages/stark-rbac/README.md
index ee57a98794..98bee09c89 100644
--- a/packages/stark-rbac/README.md
+++ b/packages/stark-rbac/README.md
@@ -1,6 +1,6 @@
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-rbac.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-rbac)
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-rbac.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-rbac)
-[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark)
+[![Build Status](https://github.com/NationalBankBelgium/stark/workflows/ci/badge.svg)](https://github.com/NationalBankBelgium/stark/actions?query=workflow%3Aci)
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark-rbac.svg)](https://david-dm.org/NationalBankBelgium/stark-rbac)
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark-rbac/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark-rbac#info=devDependencies)
[![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE)
diff --git a/packages/stark-testing/README.md b/packages/stark-testing/README.md
index 4b46fc24af..1c3155fdad 100644
--- a/packages/stark-testing/README.md
+++ b/packages/stark-testing/README.md
@@ -1,6 +1,6 @@
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-testing.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-testing)
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-testing.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-testing)
-[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark)
+[![Build Status](https://github.com/NationalBankBelgium/stark/workflows/ci/badge.svg)](https://github.com/NationalBankBelgium/stark/actions?query=workflow%3Aci)
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark-testing.svg)](https://david-dm.org/NationalBankBelgium/stark-testing)
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark-testing/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark-testing#info=devDependencies)
[![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE)
diff --git a/packages/stark-ui/README.md b/packages/stark-ui/README.md
index 9fd7f94d99..325b1d5777 100644
--- a/packages/stark-ui/README.md
+++ b/packages/stark-ui/README.md
@@ -1,6 +1,6 @@
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-ui.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-ui)
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-ui.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-ui)
-[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark)
+[![Build Status](https://github.com/NationalBankBelgium/stark/workflows/ci/badge.svg)](https://github.com/NationalBankBelgium/stark/actions?query=workflow%3Aci)
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark-ui.svg)](https://david-dm.org/NationalBankBelgium/stark-ui)
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark-ui/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark-ui#info=devDependencies)
[![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE)
diff --git a/release-publish.sh b/release-publish.sh
index 22042802e9..908f51e4bb 100644
--- a/release-publish.sh
+++ b/release-publish.sh
@@ -5,7 +5,7 @@
# provide a clean way to define/check the "current" version of node (i.e., the one we should execute the publish under/for)
## ideally we should read it from .nvmrc
# provide support for publishing only a subset of the packages (same --packages logic as in build.sh)
-# provide support for publishing locally in addition to travis
+# provide support for publishing locally in addition to GitHub Actions
set -u -e -o pipefail
@@ -22,6 +22,9 @@ IFS=$OLD_IFS # restore IFS
EXPECTED_REPO_SLUG="NationalBankBelgium/stark"
EXPECTED_NODE_VERSION="10"
+GH_ACTIONS_TAG=${GH_ACTIONS_TAG:-""}
+NPM_TOKEN=${NPM_TOKEN:-""}
+
#----------------------------------------------
# Uncomment block below to test locally
#----------------------------------------------
@@ -29,23 +32,21 @@ EXPECTED_NODE_VERSION="10"
#mkdir -p ${LOGS_DIR}
#touch ${LOGS_DIR}/build-perf.log
#NPM_TOKEN="dummy"
-#TRAVIS=true
-#TRAVIS_REPO_SLUG="NationalBankBelgium/stark"
-#TRAVIS_NODE_VERSION="10"
+#GITHUB_ACTIONS=true
+#GITHUB_REPOSITORY="NationalBankBelgium/stark"
# For normal builds:
-#TRAVIS_EVENT_TYPE="pull_request"
-#TRAVIS_TAG="fooBar"
+#GH_ACTIONS_TAG="fooBar"
# For nightly builds:
-#TRAVIS_EVENT_TYPE="cron"
+#GITHUB_EVENT_NAME="schedule"
#----------------------------------------------
NIGHTLY_BUILD=false
readonly currentDir=$(cd $(dirname $0); pwd)
-source ${currentDir}/scripts/ci/_travis-fold.sh
+source ${currentDir}/scripts/ci/_ghactions-group.sh
source ${currentDir}/util-functions.sh
cd ${currentDir}
@@ -88,72 +89,50 @@ logTrace "PROJECT_ROOT_DIR: ${PROJECT_ROOT_DIR}" 1
ROOT_PACKAGES_DIR=${PROJECT_ROOT_DIR}/dist/packages-dist
logTrace "ROOT_PACKAGES_DIR: ${ROOT_PACKAGES_DIR}" 1
-travisFoldStart "publish checks" "no-xtrace"
+ghActionsGroupStart "publish checks" "no-xtrace"
-if [[ ${TRAVIS} == true ]]; then
+if [[ ${GITHUB_ACTIONS} == true ]]; then
+ logInfo "============================================="
logInfo "Publishing to npm";
logInfo "============================================="
# Don't even try if not running against the official repo
# We don't want release to run outside of our own little world
- if [[ ${TRAVIS_REPO_SLUG} != ${EXPECTED_REPO_SLUG} ]]; then
+ if [[ ${GITHUB_REPOSITORY} != ${EXPECTED_REPO_SLUG} ]]; then
logInfo "Skipping release because this is not the main repository.";
- exit 0;
- fi
-
- # Ensuring that this is the execution for Node x
- # Without this check, we would publish a release for each node version we test under! :)
- if [[ ${TRAVIS_NODE_VERSION} != ${EXPECTED_NODE_VERSION} ]]; then
- logInfo "Skipping release because this is not the expected version of node: ${TRAVIS_NODE_VERSION}"
+ ghActionsGroupEnd "publish checks"
exit 0;
fi
logInfo "Verifying if this build has been triggered for a tag"
- # Making sure the variable does exist..
- if [[ -z ${TRAVIS_TAG+x} ]]; then
- TRAVIS_TAG=""
- fi
-
- if [[ ${TRAVIS_PULL_REQUEST} != "false" ]]; then
- logInfo "Not publishing because this is a build triggered for a pull request" 1
- exit 0;
- elif [[ ${TRAVIS_EVENT_TYPE} == "cron" ]]; then
- logInfo "Nightly build initiated by Travis cron job" 1
+
+ if [[ ${GITHUB_EVENT_NAME} == "schedule" ]]; then
+ logInfo "Nightly build initiated by GitHub Action scheduled job" 1
NIGHTLY_BUILD=true
- elif [[ ${TRAVIS_TAG} == "" ]]; then
- logInfo "Not publishing because this is not a build triggered for a tag" 1
- exit 0;
else
logInfo "This build has been triggered for a tag"
fi
logInfo "Verifying that the NPM_TOKEN is available"
- if [[ -z ${NPM_TOKEN+x} ]]; then
- NPM_TOKEN=""
- fi
-
if [[ ${NPM_TOKEN} == "" ]]; then
logInfo "Not publishing because the NPM_TOKEN environment variable is is not defined correctly" 1
- exit 0;
- fi
-
- # If any of the previous commands in the `script` section of .travis.yaml failed, then abort.
- # The variable is not set in early stages of the build, so we default to 0 there.
- # https://docs.travis-ci.com/user/environment-variables/
- if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
- logInfo "Skipping release because a previous script in the Travis build has failed";
- exit 0;
+ exit 1;
fi
fi
-travisFoldEnd "publish checks"
+ghActionsGroupEnd "publish checks"
-travisFoldStart "publish" "no-xtrace"
+logInfo "============================================="
logInfo "Publishing all packages"
+logInfo "============================================="
+# FIXME Uncomment this once GitHub Actions support nested logs
+# See: https://github.uint.cloudmunity/t5/GitHub-Actions/Feature-Request-Enhancements-to-group-commands-nested-named/m-p/45399
+#ghActionsGroupStart "publish" "no-xtrace"
+#logInfo "Publishing all packages"
for PACKAGE in ${ALL_PACKAGES[@]}
do
- travisFoldStart "publishing: ${PACKAGE}" "no-xtrace"
+ ghActionsGroupStart "publishing: ${PACKAGE}" "no-xtrace"
PACKAGE_FOLDER=${ROOT_PACKAGES_DIR}/${PACKAGE}
logTrace "Package path: ${PACKAGE_FOLDER}" 2
cd ${PACKAGE_FOLDER}
@@ -165,7 +144,7 @@ do
logTrace "Publishing the release (with tag latest)" 2
npm publish ${file} --access public
logTrace "Adapting the tag next to point to the new release" 2
- npm dist-tag add @nationalbankbelgium/${PACKAGE}@${TRAVIS_TAG} next
+ npm dist-tag add @nationalbankbelgium/${PACKAGE}@${GH_ACTIONS_TAG} next
else
logTrace "Check if nightly build is not already published."
LATEST_NPM_VERSION=`npm view @nationalbankbelgium/${PACKAGE} dist-tags.next`
@@ -184,10 +163,10 @@ do
logInfo "Package published!" 2
done
cd - > /dev/null; # go back to the previous folder without any output
- travisFoldEnd "publishing: ${PACKAGE}"
+ ghActionsGroupEnd "publishing: ${PACKAGE}"
done
-travisFoldEnd "publish"
+#ghActionsGroupEnd "publish"
# Print return arrows as a log separator
-travisFoldReturnArrows
+ghActionsGroupReturnArrows
diff --git a/scripts/ci/_ghactions-group.sh b/scripts/ci/_ghactions-group.sh
new file mode 100644
index 0000000000..217c03eebb
--- /dev/null
+++ b/scripts/ci/_ghactions-group.sh
@@ -0,0 +1,86 @@
+#!/usr/bin/env bash
+
+# private variable to track groups within this script
+ghActionsGroupStack=()
+
+GITHUB_ACTIONS=${GITHUB_ACTIONS:-}
+LOGS_FILE=${LOGS_FILE:-""}
+
+function ghActionsGroupStart() {
+ local groupName="${0#./} ${1}"
+ # get current time as nanoseconds since the beginning of the epoch
+ groupStartTime=$(date +%s%N)
+ # convert all non alphanum chars except for "-" and "." to "--"
+ local sanitizedGroupName=${groupName//[^[:alnum:]\-\.]/--}
+ # strip trailing "-"
+ sanitizedGroupName=${sanitizedGroupName%-}
+ # push the groupName onto the stack
+ ghActionsGroupStack+=("${sanitizedGroupName}|${groupStartTime}")
+
+ echo ""
+ if [[ ${GITHUB_ACTIONS} == true ]]; then
+ echo "::group::${groupName}"
+ fi
+ local enterArrow="===> ${groupName} ==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>"
+ # keep all messages consistently wide 80chars regardless of the groupName
+ echo ${enterArrow:0:100}
+ if [[ ${2:-} != "no-xtrace" ]]; then
+ # turn on verbose mode so that we have better visibility into what's going on
+ # http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html#table_02_01
+ set -x
+ fi
+}
+
+function ghActionsGroupEnd() {
+ set +x
+ local groupName="${0#./} ${1}"
+ # convert all non alphanum chars except for "-" and "." to "--"
+ local sanitizedGroupName=${groupName//[^[:alnum:]\-\.]/--}
+ # strip trailing "-"
+ sanitizedGroupName=${sanitizedGroupName%-}
+
+ # consult and update ghActionsGroupStack
+ local lastGroupIndex=$(expr ${#ghActionsGroupStack[@]} - 1)
+ local lastGroupString=${ghActionsGroupStack[$lastGroupIndex]}
+ # split the string by | and then turn that into an array
+ local lastGroupArray=(${lastGroupString//\|/ })
+ local lastSanitizedGroupName=${lastGroupArray[0]}
+
+ if [[ ${GITHUB_ACTIONS} == true ]]; then
+ local lastGroupStartTime=${lastGroupArray[1]}
+ local groupFinishTime=$(date +%s%N)
+ local groupDuration=$(expr ${groupFinishTime} - ${lastGroupStartTime})
+ local displayedDuration=$(echo "scale=1; ${groupDuration}/1000000000" | bc | awk '{printf "%.1f\n", $0}')
+
+ # write into build-perf.log file
+ local logIndent=$(expr ${lastGroupIndex} \* 2)
+ printf "%6ss%${logIndent}s: %s\n" ${displayedDuration} " " "${groupName}" >> ${LOGS_FILE}
+ fi
+
+ # pop
+ ghActionsGroupStack=(${ghActionsGroupStack[@]:0:lastGroupIndex})
+
+ # check for misalignment
+ if [[ ${lastSanitizedGroupName} != ${sanitizedGroupName} ]]; then
+ echo "GitHub Actions group mis-alignment detected! ghActionsGroupEnd expected sanitized fold name '${lastSanitizedGroupName}', but received '${sanitizedGroupName}' (after sanitization)"
+ exit 1
+ fi
+
+ local returnArrow="<=== ${groupName} <==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<=="
+ # keep all messages consistently wide 80chars regardless of the groupName
+ echo ${returnArrow:0:100}
+ echo ""
+ if [[ ${GITHUB_ACTIONS} == true ]]; then
+ echo "::endgroup::"
+ fi
+}
+
+function ghActionsGroupReturnArrows() {
+ # print out return arrows so that it's easy to see the end of the script in the log
+ echo ""
+ returnArrow="<=== ${0#./} <==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<=="
+ # keep all messages consistently wide 80chars regardless of the groupName
+ echo ${returnArrow:0:100}
+ echo "<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==="
+ echo ""
+}
diff --git a/scripts/ci/_travis-fold.sh b/scripts/ci/_travis-fold.sh
deleted file mode 100644
index 8f9c96ca50..0000000000
--- a/scripts/ci/_travis-fold.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-# private variable to track folds within this script
-travisFoldStack=()
-
-TRAVIS=${TRAVIS:-}
-
-function travisFoldStart() {
- local foldName="${0#./} ${1}"
- # get current time as nanoseconds since the beginning of the epoch
- foldStartTime=$(date +%s%N)
- # convert all non alphanum chars except for "-" and "." to "--"
- local sanitizedFoldName=${foldName//[^[:alnum:]\-\.]/--}
- # strip trailing "-"
- sanitizedFoldName=${sanitizedFoldName%-}
- # push the foldName onto the stack
- travisFoldStack+=("${sanitizedFoldName}|${foldStartTime}")
-
- echo ""
- if [[ ${TRAVIS} == true ]]; then
- echo "travis_fold:start:${sanitizedFoldName}"
- echo "travis_time:start:${sanitizedFoldName}"
- fi
- local enterArrow="===> ${foldName} ==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>"
- # keep all messages consistently wide 80chars regardless of the foldName
- echo ${enterArrow:0:100}
- if [[ ${2:-} != "no-xtrace" ]]; then
- # turn on verbose mode so that we have better visibility into what's going on
- # http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html#table_02_01
- set -x
- fi
-}
-
-function travisFoldEnd() {
- set +x
- local foldName="${0#./} ${1}"
- # convert all non alphanum chars except for "-" and "." to "--"
- local sanitizedFoldName=${foldName//[^[:alnum:]\-\.]/--}
- # strip trailing "-"
- sanitizedFoldName=${sanitizedFoldName%-}
-
- # consult and update travisFoldStack
- local lastFoldIndex=$(expr ${#travisFoldStack[@]} - 1)
- local lastFoldString=${travisFoldStack[$lastFoldIndex]}
- # split the string by | and then turn that into an array
- local lastFoldArray=(${lastFoldString//\|/ })
- local lastSanitizedFoldName=${lastFoldArray[0]}
-
- if [[ ${TRAVIS} == true ]]; then
- local lastFoldStartTime=${lastFoldArray[1]}
- local foldFinishTime=$(date +%s%N)
- local foldDuration=$(expr ${foldFinishTime} - ${lastFoldStartTime})
-
- # write into build-perf.log file
- local logIndent=$(expr ${lastFoldIndex} \* 2)
- printf "%6ss%${logIndent}s: %s\n" $(expr ${foldDuration} / 1000000000) " " "${foldName}" >> ${LOGS_DIR}/build-perf.log
- fi
-
- # pop
- travisFoldStack=(${travisFoldStack[@]:0:lastFoldIndex})
-
- # check for misalignment
- if [[ ${lastSanitizedFoldName} != ${sanitizedFoldName} ]]; then
- echo "Travis fold mis-alignment detected! travisFoldEnd expected sanitized fold name '${lastSanitizedFoldName}', but received '${sanitizedFoldName}' (after sanitization)"
- exit 1
- fi
-
- local returnArrow="<=== ${foldName} <==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<=="
- # keep all messages consistently wide 80chars regardless of the foldName
- echo ${returnArrow:0:100}
- echo ""
- if [[ ${TRAVIS} == true ]]; then
- echo "travis_time:end:${sanitizedFoldName}:start=${lastFoldStartTime},finish=${foldFinishTime},duration=${foldDuration}"
- echo "travis_fold:end:${sanitizedFoldName}"
- fi
-}
-
-function travisFoldReturnArrows() {
- # print out return arrows so that it's easy to see the end of the script in the log
- echo ""
- returnArrow="<=== ${0#./} <==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<=="
- # keep all messages consistently wide 80chars regardless of the foldName
- echo ${returnArrow:0:100}
- echo "<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==<==="
- echo ""
-}
diff --git a/scripts/ci/print-logs.sh b/scripts/ci/print-logs.sh
index 2c14d45499..cceff76d07 100644
--- a/scripts/ci/print-logs.sh
+++ b/scripts/ci/print-logs.sh
@@ -4,14 +4,14 @@ set -u -e -o pipefail
# Setup environment
readonly thisDir=$(cd $(dirname $0); pwd)
-source ${thisDir}/_travis-fold.sh
+source ${thisDir}/_ghactions-group.sh
for FILE in ${LOGS_DIR}/*; do
- travisFoldStart "print log file: ${FILE}"
+ ghActionsGroupStart "print log file: ${FILE}"
cat $FILE
- travisFoldEnd "print log file: ${FILE}"
+ ghActionsGroupEnd "print log file: ${FILE}"
done
# Print return arrows as a log separator
-travisFoldReturnArrows
+ghActionsGroupReturnArrows
diff --git a/showcase/README.md b/showcase/README.md
index bbef7d3fcc..1a91b3a16a 100644
--- a/showcase/README.md
+++ b/showcase/README.md
@@ -152,7 +152,6 @@ groupings trying to match Angular concepts:
| .prettierignore # files and directories to be excluded by prettier
| .prettierrc.js # prettier configuration file
| .stylelintrc # stylelint configuration file
-| .travis.yml # YAML file to customize the Travis build (https://travis-ci.org/)
| angular.json # Angular configuration file
| base.spec.ts # initializes the test environment
| Dockerfile # the commands that will be executed by the Docker Build command
diff --git a/showcase/e2e/protractor.browserstack.conf.js b/showcase/e2e/protractor.browserstack.conf.js
index b3de9eed68..26e697523f 100644
--- a/showcase/e2e/protractor.browserstack.conf.js
+++ b/showcase/e2e/protractor.browserstack.conf.js
@@ -1,8 +1,8 @@
const browserstack = require("browserstack-local");
-const { BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY, TRAVIS_BUILD_NUMBER } = process.env;
+const { BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY, GITHUB_RUN_NUMBER } = process.env;
const defaultConfig = require("../node_modules/@nationalbankbelgium/stark-testing/protractor.conf.js").config;
-const BROWSERSTACK_LOCAL_IDENTIFIER = TRAVIS_BUILD_NUMBER ? `travis-${TRAVIS_BUILD_NUMBER}` : "local";
+const BROWSERSTACK_LOCAL_IDENTIFIER = GITHUB_RUN_NUMBER ? `github-actions-${GITHUB_RUN_NUMBER}` : "local";
/**
* Specifies the different capabilities for BrowserStack.
diff --git a/showcase/src/app/welcome/pages/getting-started/starter-structure.ts b/showcase/src/app/welcome/pages/getting-started/starter-structure.ts
index c78df673ab..5fea60375a 100644
--- a/showcase/src/app/welcome/pages/getting-started/starter-structure.ts
+++ b/showcase/src/app/welcome/pages/getting-started/starter-structure.ts
@@ -136,7 +136,6 @@ export const starterStructure = `|
| .prettierignore # files and directories to be excluded by prettier
| .prettierrc.js # prettier configuration file
| .stylelintrc # stylelint configuration file
-| .travis.yml # YAML file to customize the Travis build (https://travis-ci.org/)
| angular.json # Angular configuration file
| base.spec.ts # initializes the test environment
| Dockerfile # the commands that will be executed by the Docker Build command
diff --git a/ssh-config b/ssh-config
deleted file mode 100644
index 10915327cc..0000000000
--- a/ssh-config
+++ /dev/null
@@ -1,7 +0,0 @@
-Host github.com
-User git
-IdentityFile ~/.ssh/stark-ssh
-StrictHostKeyChecking no
-PasswordAuthentication no
-CheckHostIP no
-BatchMode yes
diff --git a/stark-ssh.enc b/stark-ssh.enc
deleted file mode 100644
index 206f6147fe..0000000000
Binary files a/stark-ssh.enc and /dev/null differ
diff --git a/stark-ssh.pub b/stark-ssh.pub
deleted file mode 100644
index 7560e73067..0000000000
--- a/stark-ssh.pub
+++ /dev/null
@@ -1 +0,0 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC02h9c8sqRDyv4zpiw67YdAnj6TQdQOaGT7P1xyrR0k7eKyiLPlSSFyTwI9u1GOiyevoq3onkKq0LXFoJbGYAeCeHjD9GkPh+bqeGEgPRIaD2EJYnIyhHPGhUDcMtP0sLObOkOHyZIF53zC44sGZUxGOvF5UaYH9UBF5LGvrmP9xXs5FKYqMIRKmXnIDRrO7TORrjo2WgQfbJUUGj9DiF8U3fGXlvyHBugxrcuy8k9grxNOS1seJGNoY80QWF9z49fkqAd6ZCsolz5odgfKwEetPddn0KHca5Qi6qlNKZm6ILuiYzwTFb48bB7bmvsLnmdOvgvFIoIxnJzGV14f6tYq0ggEWCF0IISX9VO0huXoRohL6EDKEvcVERZNpRfiE0QZWD5J8JQn6czR6ANgf+fYnSTYeHoLa5iREGZn6lHnWoAFIucDdVERfYUlwCqPcV7ULiw7sqSBLdyOZgLJwJdkbEg85gQXJMQT8GsqZEG9w0vhRoORUuwc/BNtxZorfLNKmn3XFqtjl0kzBIQg7enjJeTuT7QB9lF347OOir7ItjOg6de0v4hiv2seTWoKegUg5UvHt6AhTv+zhX3oq3cNWlOP9qeLotezPs6EFXYbAIcGIf85g2uOfRqHzCY2uZOMjrjIodEhkTqJri0gsMzzBvvyz8VmzwBy+c+nn1m1Q== alexis.georges@nbb.be
diff --git a/starter/README.md b/starter/README.md
index 359041cc05..9b63469c11 100644
--- a/starter/README.md
+++ b/starter/README.md
@@ -152,7 +152,6 @@ groupings trying to match Angular concepts:
| .prettierignore # files and directories to be excluded by prettier
| .prettierrc.js # prettier configuration file
| .stylelintrc # stylelint configuration file
-| .travis.yml # YAML file to customize the Travis build (https://travis-ci.org/)
| angular.json # Angular configuration file
| base.spec.ts # initializes the test environment
| Dockerfile # the commands that will be executed by the Docker Build command