Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add github actions #6

Merged
merged 19 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
18 changes: 18 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/master/cspell.schema.json",
"import": ["@taiga-ui/cspell-config"],
"files": ["*/*.*"],
"ignorePaths": [
".git",
".gitignore",
".cspell.json",
"**/dist/**",
"**/assets/**",
"**/node_modules/**",
"*.{log,svg,snap,png,ogv,yml}",
"**/package.json",
"**/tsconfig*.json"
],

"ignoreWords": ["lumbermill", "Segoe", "Roboto", "Consolas", "Menlo", "Neue", "apos", "stafffrter"]
}
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build
on:
pull_request:
push:
branches:
- main

jobs:
build:
name: Build package
MishaZhem marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npx nx build

concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy
on:
workflow_dispatch:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npx nx build-gh-pages taiga-lumbermill
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist/apps/taiga-lumbermill/browser
silent: false
clean: true

concurrency:
group: deploy-${{ github.head_ref }}
cancel-in-progress: true
54 changes: 54 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lint
on: [pull_request]

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run typecheck

cspell:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run cspell -- --no-progress

prettier:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run prettier -- --write

stylelint:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run stylelint -- --fix

eslint:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run lint -- --fix

result:
needs: [prettier, eslint, stylelint, cspell, typecheck]
runs-on: ubuntu-latest
name: Lint result
steps:
- run: echo "Success"

concurrency:
group: lint-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on:
pull_request:
push:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]

- name: Run tests
run: npx nx run-many --target test --all --coverage

- name: Archive coverage artifacts
uses: actions/[email protected]
with:
name: coverage-${{ github.workflow }}-${{ github.run_id }}
path: coverage

concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
1 change: 1 addition & 0 deletions apps/taiga-lumbermill/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable */

MishaZhem marked this conversation as resolved.
Show resolved Hide resolved
export default {
displayName: 'taiga-lumbermill',
preset: '../../jest.preset.js',
Expand Down
13 changes: 13 additions & 0 deletions apps/taiga-lumbermill/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@
},
"defaultConfiguration": "production"
},
"build-gh-pages": {
"executor": "nx:run-commands",
"options": {
"parallel": false,
"commands": [
"echo 'Github pages require special 404.html'",
"echo 'Read more: https://angular.io/guide/deployment#deploy-to-github-pages'",
"echo ------",
"nx build taiga-lumbermill -c production",
"cp dist/apps/taiga-lumbermill/browser/index.html dist/apps/taiga-lumbermill/browser/404.html"
]
}
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
Expand Down
4 changes: 4 additions & 0 deletions apps/taiga-lumbermill/src/app/app.component.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* {
margin: 0;
padding: 0;
}
2 changes: 2 additions & 0 deletions apps/taiga-lumbermill/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-ignore
// @ts-nocheck
import {TestBed} from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing';

Expand Down
2 changes: 0 additions & 2 deletions apps/taiga-lumbermill/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable */

import {bootstrapApplication} from '@angular/platform-browser';

import {AppComponent} from './app/app.component';
Expand Down
2 changes: 2 additions & 0 deletions apps/taiga-lumbermill/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'jest-preset-angular/setup-jest';
// import '@types/jest';

// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
Expand Down
3 changes: 2 additions & 1 deletion apps/taiga-lumbermill/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"types": ["jest", "node"]
},
"files": [],
"include": [],
Expand Down
Loading