Skip to content

Commit

Permalink
add basic ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbush committed Sep 19, 2024
1 parent ea9536d commit dbe0216
Show file tree
Hide file tree
Showing 8 changed files with 3,488 additions and 1,505 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/angular-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Angular Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint
25 changes: 25 additions & 0 deletions .github/workflows/angular-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Angular Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --no-watch --no-progress --browsers=ChromeHeadless
25 changes: 25 additions & 0 deletions .github/workflows/prettier-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Prettier Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npm run format:check
7 changes: 7 additions & 0 deletions postrify-frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2,
"semi": true
}
14 changes: 14 additions & 0 deletions postrify-frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,22 @@
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
43 changes: 43 additions & 0 deletions postrify-frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");

module.exports = tseslint.config(
{
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",
},
],
},
},
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
}
);
Loading

0 comments on commit dbe0216

Please sign in to comment.