Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Angular CI

on:
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: uniplanWeb

jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version-file: 'uniplanWeb/.nvmrc'
cache: 'npm'
cache-dependency-path: uniplanWeb/package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: |
set -o pipefail
npm run lint | tee lint-output.log

- name: Run unit tests
run: |
set -o pipefail
npm run test -- --no-watch --no-progress --browsers=ChromeHeadless --code-coverage | tee test-output.log

- name: Build
run: npm run build

- name: Job summary
if: always()
run: |
{
echo "## Lint"
echo '```'
if [ -f lint-output.log ]; then
cat lint-output.log
else
echo "Lint did not run (an earlier step failed)."
fi
echo '```'
echo
echo "## Coverage"
echo '```'
if [ -f test-output.log ]; then
grep -A 5 "Coverage summary" test-output.log || echo "No coverage data captured."
else
echo "Tests did not run (an earlier step failed)."
fi
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
1 change: 1 addition & 0 deletions uniplanWeb/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
16 changes: 14 additions & 2 deletions uniplanWeb/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,23 @@
"src/styles.scss"
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": [
"angular-eslint"
]
}
}
}
87 changes: 87 additions & 0 deletions uniplanWeb/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// @ts-check
const eslint = require("@eslint/js");
const { defineConfig } = require("eslint/config");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");

module.exports = defineConfig([
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: "app",
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: "app",
style: "kebab-case",
},
],
"@angular-eslint/contextual-lifecycle": "error",
"@angular-eslint/no-empty-lifecycle-method": "error",
"@angular-eslint/no-input-rename": "error",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-output-native": "error",
"@angular-eslint/no-output-on-prefix": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/prefer-standalone": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@angular-eslint/use-lifecycle-interface": "warn",

"@typescript-eslint/no-unused-vars": "error",
"@angular-eslint/prefer-inject": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
Comment thread
Manastirski marked this conversation as resolved.
"@angular-eslint/prefer-on-push-component-change-detection": "off",

"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
},
],
},
},
{
files: ["**/*.html"],
extends: [
angular.configs.templateRecommended,
angular.configs.templateAccessibility,
],
rules: {
"@angular-eslint/template/banana-in-box": "error",
"@angular-eslint/template/eqeqeq": "error",
"@angular-eslint/template/no-negated-async": "error",
"@angular-eslint/template/prefer-control-flow": "error",

"@angular-eslint/template/alt-text": "error",
"@angular-eslint/template/click-events-have-key-events": "error",
"@angular-eslint/template/elements-content": "error",
"@angular-eslint/template/interactive-supports-focus": "error",
"@angular-eslint/template/label-has-associated-control": "error",
"@angular-eslint/template/mouse-events-have-key-events": "error",
"@angular-eslint/template/no-autofocus": "error",
"@angular-eslint/template/no-distracting-elements": "error",
"@angular-eslint/template/role-has-required-aria": "error",
"@angular-eslint/template/table-scope": "error",
"@angular-eslint/template/valid-aria": "error",
},
},
]);
Loading