Skip to content

Commit

Permalink
Update README #18
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Jun 1, 2020
1 parent c0684f5 commit d9092fc
Showing 1 changed file with 51 additions and 22 deletions.
73 changes: 51 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,27 @@ See [action.yml](action.yml)
Basic:
```yaml
steps:
- uses: actions/checkout@master
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: '1.2.0'
- run: nimble build -Y
- run: nimble test -Y
- uses: actions/checkout@master
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: '1.2.0'
- run: nimble build -Y
- run: nimble test -Y
```
Use cache:
```yaml
steps:
- uses: actions/checkout@master
- name: Cache choosenim
id: cache-choosenim
uses: actions/cache@v1
with:
path: ~/.choosenim
key: ${{ runner.os }}-choosenim-stable
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-stable
- uses: jiro4989/setup-nim-action@v1
- run: nimble build -Y
- run: nimble test -Y
- uses: actions/checkout@master
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v1
- run: nimble build -Y
- run: nimble test -Y
```
Matrix Testing:
Expand All @@ -58,6 +52,41 @@ jobs:
- run: nimble build
```
Use `date` cache-key if you want to use `stable` or `devel` or `devel --latest` and caching.

```yaml
jobs:
test_devel:
runs-on: ubuntu-latest
env:
nim_version: 'devel'
steps:
- uses: actions/checkout@v1
- name: Get Date
id: get-date
run: echo "::set-output name=date::$(date "+%Y-%m-%d")"
shell: bash
- name: Cache choosenim
id: cache-choosenim
uses: actions/cache@v1
with:
path: ~/.choosenim
key: ${{ runner.os }}-choosenim-${{ env.nim_version }}-${{ steps.get-date.outputs.date }}
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ env.nim_version }}-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.nim_version }}
- run: nimble build
```

# License

MIT

0 comments on commit d9092fc

Please sign in to comment.