Skip to content

Commit

Permalink
Upgrade to Node20 (#11)
Browse files Browse the repository at this point in the history
* Upgrade to node20

* use tags for easier PR testing

* better comment

* update README with release instructions and package.json with new version

* Ensure tag is updated before pushing

Co-authored-by: Paweł Kowalski <[email protected]>

* rev examples in readme, note that step in release docs

---------

Co-authored-by: Paweł Kowalski <[email protected]>
  • Loading branch information
nonrational and pavelloz authored Feb 22, 2024
1 parent d0a9123 commit 9072567
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20.11.1
- name: Install deps and build dist
run: npm i

Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/run-cache-result-action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: run-cache-result-action
on: push

# tag: `edge` should point to master or a branch commit to verify
# that a change is valid before merging.

# To update edge to the current commit, use:
# $ git tag -f edge HEAD && git push -f origin edge

jobs:
check-sha-result:
runs-on: ubuntu-latest
Expand All @@ -9,26 +15,26 @@ jobs:
optional-result: ${{ steps.restore-secondary-cache.outputs.result }}
steps:
- id: restore-cache
uses: parallel-markets/cache-result-action@f6b4cbf83108f6b777dfc78925e71da352189d05
uses: parallel-markets/cache-result-action@edge

- id: restore-secondary-cache
uses: parallel-markets/cache-result-action@f6b4cbf83108f6b777dfc78925e71da352189d05
uses: parallel-markets/cache-result-action@edge
with:
cache-group: optional

test:
needs: check-sha-result
runs-on: ubuntu-latest
steps:
- uses: parallel-markets/cache-result-action@f6b4cbf83108f6b777dfc78925e71da352189d05
- uses: parallel-markets/cache-result-action@edge
with:
result: success

optional-test:
needs: check-sha-result
runs-on: ubuntu-latest
steps:
- uses: parallel-markets/cache-result-action@f6b4cbf83108f6b777dfc78925e71da352189d05
- uses: parallel-markets/cache-result-action@edge
with:
result: success
cache-group: optional
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- id: last-run
uses: parallel-markets/cache-result-action@v1.0.0
uses: parallel-markets/cache-result-action@v2

- run: make test
if: steps.last-run.outputs.result != 'success'

- uses: parallel-markets/cache-result-action@v1.0.0
- uses: parallel-markets/cache-result-action@v2
with:
result: success
```
Expand All @@ -45,15 +45,27 @@ jobs:
prev-result: ${{ steps.last-run.outputs.result }}
steps:
- id: last-run
uses: parallel-markets/cache-result-action@v1.0.0
uses: parallel-markets/cache-result-action@v2
test:
runs-on: ubuntu-latest
needs: fetch-prev-result
if: needs.fetch-prev-result.outputs.prev_result != 'success'
steps:
- run: make test
- uses: parallel-markets/cache-result-action@v1.0.0
- uses: parallel-markets/cache-result-action@v2
with:
result: success
```

## Development

When opening a PR, update the `edge` tag to ensure that `.github/workflows/run-cache-result-action.yml` exercises any changes prior to merging. Additionally, update the version in `package.json` according to semver as appropriate. If the change warrants a major release, update the [examples above](#examples).

### Releasing

After merging, update version tags according to semver, as appropriate. As a courtesy, also update `edge` to point to the latest commit.

To update edge to the current commit, use:

$ git tag -f edge HEAD && git push -f origin edge
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ outputs:
result:
description: 'Most recent result'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cache-result-action",
"version": "0.0.1",
"version": "2.0.0",
"description": "Github Action for storing results from previous runs by SHA",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 9072567

Please sign in to comment.