https://github.com/dsi-hug/actions
😺 Reusable Github workflows mainly designed to be used by the HUG organization's team
https://github.com/dsi-hug/actions
github-actions reusable-workflow yaml
Last synced: 21 days ago
JSON representation
😺 Reusable Github workflows mainly designed to be used by the HUG organization's team
- Host: GitHub
- URL: https://github.com/dsi-hug/actions
- Owner: DSI-HUG
- License: gpl-3.0
- Created: 2024-06-07T12:12:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-05T09:27:29.000Z (over 1 year ago)
- Last Synced: 2025-04-12T17:44:38.810Z (about 1 year ago)
- Topics: github-actions, reusable-workflow, yaml
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
dsi-hug/actions
Reusable Github workflows mainly designed to be used by the HUG organization's team
The following workflows are available:
#### - Setup
Runs the following steps in order:
```
1. Checkout sources
2. Setup chrome (optional)
3. Setup git
4. Setup node
5. Setup npm
6. Cache .angular and node_modules
7. Install npm dependencies
```
#### - Action
Runs the following steps in order and also apply a matrix strategy to run them on different types of machine and node versions:
```md
1. Run the setup workflow
2. Lint (optional)
3. Test (optional)
4. Build (optional)
5. Release dry-run (optional)
6. Release (optional)
```
## Usage
### [dsi-hug/actions/setup](./setup/action.yml)
```yaml
jobs..steps[*]:
- name: Setup
uses: dsi-hug/actions/setup@v4
with:
#
# Node version to be used.
#
# @examples: 18, '12.x', '10.15.1', '>=10.15.0', 'lts/Hydrogen', '16-nightly', 'latest', 'node'
# @default: 24
#
node-version: 24
#
# Node architecture to be used.
#
# @examples: x86, x64
# @default: '', use system architecture by default
#
node-arch: ''
#
# Whether to install the latest Chrome version.
#
# @default: false
#
setup-chrome: false
```
### [dsi-hug/actions/.github/workflows/action.yml](./.github/workflows/action.yml)
```yaml
jobs.:
uses: dsi-hug/actions/.github/workflows/action.yml@v4
with:
#
# The working directory of where to run the commands.
#
# @default: '.'
#
working-directory: '.'
#
# Type(s) of machine to run the job on.
#
# @see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
# @default: '["ubuntu-latest"]'
#
runs-on: '["ubuntu-latest"]'
#
# Node version(s) to be used.
#
# @examples: '[18, 20]', '[12.x]', '[10.15.1]', '[>=10.15.0]', '[lts/Hydrogen]', '[16-nightly]', '[latest]', '[node]'
# @default: '[24]'
#
node-versions: '[24]'
#
# Node architecture to be used.
#
# @examples: x86, x64
# @default: '', use system architecture by default
#
node-arch: ''
#
# Whether to install the latest Chrome version.
#
# @default: false
#
setup-chrome: false
#
# Whether to run the command `npm run lint`.
#
# @default: false
#
lint: false
#
# Whether to run the command `npm run test:ci`.
#
# @default: false
#
test: false
#
# Whether to run the command `npm run build`.
#
# @default: false
#
build: false
#
# Whether to run the command `npm run release`.
# If required, tokens such as NPM_TOKEN and GH_TOKEN can be passed as secrets.
#
# @default: false
#
release: false
#
# Whether to run the command `npm run release:dry-run`.
# If required, tokens such as NPM_TOKEN and GH_TOKEN can be passed as secrets.
#
# @default: false
#
dry-run: false
```
## Examples
1. Setup everything on a project and runs e2e tests.
```yaml
jobs:
ci_e2e:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: dsi-hug/actions/setup@v4
with:
- setup-chrome: true
- name: Run e2e tests
run: ...
```
2. Runs `lint` and `test` jobs on a desired project, with specific `platforms` and `node versions`.
```yaml
jobs:
ci_tests:
uses: dsi-hug/actions/.github/workflows/action.yml@v4
with:
working-directory: projects/package-a
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[22, 24]'
lint: true
test: true
```
3. Runs `lint`, `test`, `build` and `release` jobs on a desired project.
```yaml
jobs:
ci_release:
uses: dsi-hug/actions/.github/workflows/action.yml@v4
secrets:
GIT_USER_NAME: 'dsi-hug-bot'
GIT_USER_EMAIL: 'dsi-hug-bot@users.noreply.github.com'
GH_TOKEN: ${{ secrets.YOUR_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.YOUR_NPM_TOKEN }}
with:
working-directory: projects/package-a
lint: true
test: true
build: true
release: true
```
## Credits
Copyright (C) 2024 [HUG - Hôpitaux Universitaires Genève][dsi-hug]
[][dsi-hug]
[dsi-hug]: https://github.com/dsi-hug