Skip to content

Commit 1c29961

Browse files
committed
docs: ✏️ add usage example at README.md
1 parent be6eeb2 commit 1c29961

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,41 @@ Create a workflow `.yml` file in your repositories `.github/workflows` directory
1919
### Example workflow - match Angular versions
2020

2121
```yaml
22-
todo: 'Complete example later'
22+
name: Node.js CI
23+
24+
on:
25+
push:
26+
branches: [master]
27+
pull_request:
28+
branches: [master]
29+
30+
jobs:
31+
build:
32+
runs-on: ubuntu-latest
33+
34+
strategy:
35+
matrix:
36+
node-version: [10.x, 12.x, 14.x]
37+
angular-version: [8.0.0, 9.0.0, 10.0.0]
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Use Node.js ${{ matrix.node-version }}
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: ${{ matrix.node-version }}
45+
- name: Change to the right Angular version
46+
uses: ngworker/angular-versions-action@v1
47+
with:
48+
angular-version: ${{ matrix.angular-version }}
49+
50+
- run: yarn
51+
- run: yarn lint
52+
- run: yarn build
53+
- run: yarn test
2354
```
2455
25-
This will replace the version of several dependencies related to Angular in the package.json. It will use versions compatible with the given Angular version.
56+
This example use the github matrix to build, lint and test your code against different versions of `Angular`. This should be specially useful for library authors.
2657

2758
### Supported Angular versions
2859

0 commit comments

Comments
 (0)