Skip to content

Commit

Permalink
chore: add github actions (#6)
Browse files Browse the repository at this point in the history
* feat: add workflows

* chore: add workflow build

* fix: fix tests and build

* fix: change deploy

* fix: change build workflow

* chore: add cspell

* chore: Add cspell and typecheck

* fix: add build-gh-pages target

* fix: fix deploy

* fix: change test command

* chore: add build workflow

* chore: Change for main branch

* fix: fix package-lock.json

* chore: delete tsconfig.spec.json

* chore: delete extra code

* chore: delete extra code #2

* chore: exclute specs

* fix: delete style for app

---------

Co-authored-by: Vladimir Potekhin <vladimir.potekh@gmail.com>
  • Loading branch information
MishaZhem and vladimirpotekhin authored Jul 11, 2024
1 parent 2527043 commit 6d8465e
Show file tree
Hide file tree
Showing 12 changed files with 454 additions and 200 deletions.
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 app
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/checkout@v1.65.3
- uses: taiga-family/ci/actions/setup/variables@v1.65.3
- uses: taiga-family/ci/actions/setup/node@v1.65.3
- 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/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2
- run: npx nx build-gh-pages taiga-lumbermill
- uses: JamesIves/github-pages-deploy-action@v4.6.3
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/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2
- run: npm run typecheck

cspell:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2
- run: npm run cspell -- --no-progress

prettier:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2
- run: npm run prettier -- --write

stylelint:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2
- run: npm run stylelint -- --fix

eslint:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2
- 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/checkout@v1.65.2
- uses: taiga-family/ci/actions/setup/variables@v1.65.2
- uses: taiga-family/ci/actions/setup/node@v1.65.2

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

- name: Archive coverage artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: coverage-${{ github.workflow }}-${{ github.run_id }}
path: coverage

concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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
Empty file.
1 change: 0 additions & 1 deletion apps/taiga-lumbermill/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {NxWelcomeComponent} from './nx-welcome.component';
selector: 'app-root',
imports: [NxWelcomeComponent, RouterModule, TuiRoot],
templateUrl: './app.component.html',
styleUrl: './app.component.less',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
Expand Down
Loading

0 comments on commit 6d8465e

Please sign in to comment.