Skip to content

Commit

Permalink
chore: github worlflow
Browse files Browse the repository at this point in the history
  • Loading branch information
voznik committed Oct 16, 2023
1 parent 71c4824 commit 1c03c05
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 188 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,40 @@ jobs:
path:
dist/packages
# !dist/**/*.md
# Build if release published
- name: Build Demo
# if: github.event.release.published
run: npm run build:demo && npm run compodoc
###
# - name: Setup Pages for demo
# uses: actions/configure-pages@v3
###
- name: Upload demo artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'dist/demo'

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action

publish:
# if: github.event.pull_request.merged
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/dist
/docs
/documentation
/public
/tmp
/out-tsc
**/builds
Expand Down
36 changes: 30 additions & 6 deletions examples/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/demo",
"index": "examples/demo/src/index.html",
"main": "examples/demo/src/main.ts",
"polyfills": ["zone.js"],
"polyfills": [
"zone.js"
],
"tsConfig": "examples/demo/tsconfig.app.json",
"assets": ["examples/demo/src/favicon.ico", "examples/demo/src/assets"],
"assets": [
"examples/demo/src/favicon.ico",
"examples/demo/src/assets"
],
"styles": [
"node_modules/todomvc-common/base.css",
"node_modules/todomvc-app-css/index.css"
Expand Down Expand Up @@ -69,14 +76,21 @@
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": ["examples/demo/**/*.ts", "examples/demo/**/*.html"]
"lintFilePatterns": [
"examples/demo/**/*.ts",
"examples/demo/**/*.html"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": {
"jestConfig": "examples/demo/jest.config.ts",
"passWithNoTests": true
Expand All @@ -87,6 +101,16 @@
"codeCoverage": true
}
}
},
"file-server": {
"executor": "@nrwl/web:file-server",
"options": {
"buildTarget": "demo:build:production",
"port": 4201,
"host": "0.0.0.0",
"proxyUrl": "http://localhost:4201?",
"watch": true
}
}
}
}
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Config } from 'jest';

const config: Config = {
projects: getJestProjects(),
globalSetup: 'jest-preset-angular/global-setup',
};

export default config;
28 changes: 27 additions & 1 deletion jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
const nxPreset = require('@nx/jest/preset').default;

module.exports = { ...nxPreset };
const CI = process.env.CI === 'true' || true;

/** @type {import('jest').Config} */
const config = {
...nxPreset,
collectCoverage: CI,
coverageReporters: [
'html',
'text-summary',
'json',
['lcov', { file: 'rxdb-coverage.lcov' }],
['json-summary', { file: 'rxdb-coverage-summary.json' }],
],
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/*.{stories,worker}.ts',
'!**/index.ts',
'!**/node_modules/**',
],
bail: true,
verbose: true,
// resetModules: true,
// clearMocks: true,
passWithNoTests: true,
};

module.exports = config;
139 changes: 8 additions & 131 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"_postinstall": "node ./decorate-angular-cli.js && npm run ngcc",
"ngcc": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
"start": "nx run demo:serve",
"build:prod": "npm run ng-high-memory -- build --prod",
"build:demo": "nx run demo:build",
"build:sourcemaps": "npm run ng-high-memory -- build --prod --sourceMap=true --statsJson",
"packages:test": "npm run nx -- run-many --target=test --projects=rxdb,kinto --ci --run-in-band --parallel --pass-with-no-tests && npm run packages:test:merge",
"packages:test:merge": "./node_modules/.bin/lcov-result-merger 'coverage/packages/*.lcov' coverage/lcov.info",
Expand All @@ -58,7 +58,6 @@
"packages:publish:dev": "ts-node tools/scripts/publish-dev-builds.ts",
"test": "nx test",
"test:hook": "npm run affected:test -- --reporters='jest-junit' --parallel --pass-with-no-tests --base=master --head=HEAD",
"lint": "nx workspace-lint && ng lint",
"lint:hook": "npm run affected:lint -- --parallel --base=master --head=HEAD",
"lint:uncommitted": "npm run affected:lint -- --parallel --fix --uncommitted",
"e2e": "ng e2e",
Expand Down Expand Up @@ -130,7 +129,7 @@
"@nx/linter": "16.8.1",
"@nx/workspace": "16.8.1",
"@schematics/angular": "~16.2.0",
"@twittwer/compodoc": "1.5.1",
"@twittwer/compodoc": "1.10.0",
"@types/dotenv": "8.2.0",
"@types/fs-extra": "^11.0.2",
"@types/jest": "^29.4.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/rxdb/collection/src/lib/rxdb-async-no-zone.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import { Pipe, PipeTransform } from '@angular/core';
* @link https://stackoverflow.com/questions/35513015/async-pipe-not-rendering-the-stream-updates

Check warning on line 9 in packages/rxdb/collection/src/lib/rxdb-async-no-zone.pipe.ts

View workflow job for this annotation

GitHub Actions / build

Invalid JSDoc tag name "link"
* To not have to run changeDetection on each emit for each subscribed query,
* we use a different async-pipe that runs the change-detection on emit.
*
* @note in Angular 10+ you may need to disable checking of a binding expression

Check warning on line 12 in packages/rxdb/collection/src/lib/rxdb-async-no-zone.pipe.ts

View workflow job for this annotation

GitHub Actions / build

Invalid JSDoc tag name "note"
* by surrounding the expression in a call to the $any() cast pseudo-function
* in your html template, e.g.
*
* ``` *ngIf="$any(todos$ | asyncNoZone) as todos"> ```
*
*/
@Pipe({
name: 'asyncNoZone',
Expand Down
Loading

0 comments on commit 1c03c05

Please sign in to comment.