From d9092fc7f13b19d5225dfa7b5fffb71c9502257f Mon Sep 17 00:00:00 2001 From: jiro4989 Date: Mon, 1 Jun 2020 13:50:47 +0000 Subject: [PATCH] Update README #18 --- README.md | 73 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 5df19a155..af2d192ba 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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