Skip to content

Commit

Permalink
chore(ci): move to GitHub Actions (#2933)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg authored Nov 5, 2021
1 parent 7f739d4 commit 6800990
Show file tree
Hide file tree
Showing 68 changed files with 3,050 additions and 3,357 deletions.
136 changes: 136 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: PR check
on: [ push, pull_request ]
jobs:
build-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: npm ci
- run: npm run build:packages
- uses: actions/upload-artifact@v2
with:
name: built-packages
path: 'dist/'
retention-days: 1
build-docs:
needs: build-packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm ci
- run: npm run docs:build
build-playground:
needs: build-packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm ci
- uses: actions/download-artifact@v2
with:
name: built-packages
path: dist
- run: npm run build playground -- --configuration=production-wp
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: '14'
# - run: npm ci
# - run: npm run ci:lint
# e2e:
# needs: build-packages
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: '14'
# - run: npm ci
# - uses: actions/download-artifact@v2
# with:
# name: built-packages
# path: dist
# - name: BrowserStack Setup
# uses: 'browserstack/github-actions@master'
# with:
# username: ${{ secrets.BROWSERSTACK_USERNAME }}
# access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
# - name: Start BrowserStackLocal Tunnel
# uses: browserstack/github-actions/setup-local@master
# with:
# local-testing: start
# - name: Test
# run: npm run ng -- e2e playground-e2e --configuration=production-wp
# - name: Stop BrowserStackLocal Tunnel
# uses: browserstack/github-actions/setup-local@master
# with:
# local-testing: stop
unit-test:
needs: build-packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm ci
- uses: actions/download-artifact@v2
with:
name: built-packages
path: dist
- name: BrowserStack Setup
uses: 'browserstack/github-actions@master'
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: Start BrowserStackLocal Tunnel
uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
- name: Test packages
run: npm run test playground -- -c=production-wp --watch=false
- name: Test schematics
run: npm run test:schematics
- name: Stop BrowserStackLocal Tunnel
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
packages-smoke:
needs: build-packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- uses: actions/download-artifact@v2
with:
name: built-packages
path: packages-smoke/.lib/
- run: npm ci
working-directory: packages-smoke
- name: Build
run: npm run build -- --configuration=production
working-directory: packages-smoke
- name: E2E
run: npm run e2e
working-directory: packages-smoke
- name: SSR
run: |
npm run build:ssr
npm run serve:ssr
working-directory: packages-smoke
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

22 changes: 21 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
},
"configurations": {
"production-wp": {
"devServerTarget": "playground:production-wp"
"devServerTarget": "playground:serve:production-wp"
}
}
},
Expand Down Expand Up @@ -250,6 +250,26 @@
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"production-wp": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb"
}
],
"fileReplacements": [
{
"replace": "docs/environments/environment.ts",
"with": "docs/environments/environment.prod.ts"
}
],
"outputHashing": "all",
"tsConfig": "docs/tsconfig.wp.json"
}
},
"defaultConfiguration": "production"
Expand Down
8 changes: 8 additions & 0 deletions docs/tsconfig.wp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.app.json",
"paths": {
"@nebular/*": [
"dist/*"
]
}
}
58 changes: 12 additions & 46 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-sauce-launcher'),
require('karma-browserstack-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
Expand Down Expand Up @@ -39,11 +38,6 @@ module.exports = function (config) {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--window-size=1024,768'],
},
SauceChromeCI: {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest',
},
BrowserstackChromeCI: {
base: 'BrowserStack',
browser: 'Chrome',
Expand All @@ -52,50 +46,22 @@ module.exports = function (config) {
os_version: '10',
},
},
sauceLabs: {
testName: 'Nebular Unit Tests',
startConnect: false,
recordVideo: false,
recordScreenshots: false,
idleTimeout: 600,
commandTimeout: 600,
maxDuration: 5400,
},
browserStack: {
project: 'Nebular Unit Tests',
};

if (process.env.CI) {
config.browserStack = {
startTunnel: false,
retryLimit: 1,
build: process.env.BROWSERSTACK_BUILD_NAME,
project: process.env.BROWSERSTACK_PROJECT_NAME,
tunnelIdentifier: process.env.BROWSERSTACK_LOCAL_IDENTIFIER,
timeout: 600,
pollingTimeout: 20000,
video: false,
},
};

if (process.env['TRAVIS']) {
const [platform] = process.env.MODE.split('_');
const buildId = `TRAVIS #${process.env['TRAVIS_BUILD_NUMBER']} (${process.env['TRAVIS_BUILD_ID']})`;

user: process.env.BROWSERSTACK_USERNAME,
key: process.env.BROWSERSTACK_ACCESS_KEY,
};
configuration.singleRun = true;

if (platform === 'sauce') {
const key = require('./scripts/ci/sauce/config');

configuration.reporters.push('saucelabs');
configuration.sauceLabs.build = buildId;
configuration.sauceLabs.tunnelIdentifier = process.env['TRAVIS_JOB_ID'];
configuration.sauceLabs.username = process.env['SAUCE_USERNAME'];
configuration.sauceLabs.accessKey = key;
configuration.browsers = ['SauceChromeCI'];
} else if (platform === 'browserstack') {
const key = require('./scripts/ci/browserstack/config');

configuration.reporters.push('BrowserStack');
configuration.browserStack.build = buildId;
configuration.browserStack.tunnelIdentifier = process.env['TRAVIS_JOB_ID'];
configuration.browserStack.username = process.env['BROWSER_STACK_USERNAME'];
configuration.browserStack.accessKey = key;
configuration.browsers = ['BrowserstackChromeCI'];
}
configuration.browsers = ['BrowserstackChromeCI'];
configuration.reporters.push('BrowserStack');
}

config.set(configuration);
Expand Down
Loading

0 comments on commit 6800990

Please sign in to comment.