GithubActionsTest
workflows:
- dev-test: runs on all push events ignores main, tags and *.md files
- pre-release: runs only on semver tags including -alpha | -beta | -next if check-tags action works and ignores all branches
- main-release: runs only pull_request merged to branch main and if check-tags action works
composite run steps action)
actions: (- build-test: npm run test and npm run buld // you need to use actions/setup-node@v2 before in your workflow because
uses:
is currently not allowed in composite actions - check-tags: checks git tag and npm version for a repository to prevent wrong publications.
set version
`npm version -m "..." (major | minor | patch)``
trigger workflows
-
dev-test:
git push origin <branch>
-
pre-release:
git push origin --tags
- before run
npm version prerelease --preid=next -m "test prerelease"
or runnpm version <0.1.5-beta.0>
for a custom version
- before run
-
main-release: on pull request
git checkout -b release-<v*.*.*>
- ... code and wait for pull request review
- shortly before the pull request will be merged
git push origin --tags
-
check-tag: on push tags
git push origin --tags
-
gh-pages: on push branch main
- build ng app and deploys dist/test-app as pages
-
github-script-test: on push branch main
- test for actions/github-script
-
on-dispatch: on push tags or workflow_dispatch with input refs/tags/< version >
- test github.ref vs. github.event.inputs.ref
-
test-artifacts: on workflow_dispatch
- test adjust build artifacts
-
test-setup-node: on push main
- test node and npm versions
Links
-
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif
-
https://docs.github.com/en/actions/reference/events-that-trigger-workflows
-
https://stackoverflow.com/questions/58862864/github-actions-ci-conditional-regex
-
https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
-
https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
-
https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action
Trigger workflow
- on: pull_request
- if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release-') .github\workflows\on-pr-head-ref-release.yml
This project was generated with Angular CLI version 11.1.1.
Development server
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Build
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Running unit tests
Run ng test
to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e
to execute the end-to-end tests via Protractor.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.