Skip to content

Commit

Permalink
cleanup and standardize output names
Browse files Browse the repository at this point in the history
Several breaking changes:

- Renamed `binPath` -> `bin-path`
- Renamed `version` -> `nimskull-version`
- Renamed `commit` -> `nimskull-commit`
- The action is now compiled into ESM

Some fixes:

- Make sure to specify tool cache instead of "cache" as those are
  different from one another.
- Add Windows to test matrix.
- Marked important inputs as required, although defaults are still
  provided for them.
- Configured dependabot for npm.
- Added branding.
- Now fetches 100 releases per iteration. This is because doing so have
  the same cost as fetching 10.
  • Loading branch information
alaviss committed Jan 31, 2024
1 parent f6e8ade commit e372164
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 38,450 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2024 Leorize <[email protected]>
# SPDX-License-Identifier: CC0-1.0

/dist/** binary linguist-generated=true
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ updates:
schedule:
interval: "daily"

# Maintain dependencies for container images
- package-ecosystem: "docker"
directory: "/containers"
# Maintain dependencies for the action
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
1 change: 0 additions & 1 deletion .github/workflows/built.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
run: |
if ! git diff --exit-code -- dist; then
echo '::error::There are differences between commit and code built. Make sure that `npm run build` is run before commiting. Check log for more details.'
git diff -- dist
exit 1
fi
shell: bash
30 changes: 19 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ on:

schedule:
# Run the check weekly so we can be sure that it still works
- cron: '0 0 * * 0'
- cron: "0 0 * * 0"

jobs:
check:
strategy:
matrix:
runner: [ubuntu-latest, macos-latest]
runner: [ubuntu-latest, macos-latest, windows-latest]
spec:
- 0.1.0-dev.20070
- '*'
- '>0.0.0'
- '>0.1.0-dev.20066 <0.1.0-dev.20074'
- 0.1.0-dev.21195
- "*"
- ">0.0.0"
- ">0.1.0-dev.20066 <0.1.0-dev.20074"
include:
- spec: 0.1.0-dev.20070
expect: 0.1.0-dev.20070
- spec: '>0.1.0-dev.20066 <0.1.0-dev.20074'
- spec: 0.1.0-dev.21195
expect: 0.1.0-dev.21195
- spec: ">0.1.0-dev.20066 <0.1.0-dev.20074"
expect: 0.1.0-dev.20072
exclude:
# Windows is not supported by this version
- runner: windows-latest
spec: ">0.1.0-dev.20066 <0.1.0-dev.20074"

name: Test installation for spec ${{ matrix.spec }} on ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
Expand All @@ -40,7 +44,9 @@ jobs:
nimskull-version: ${{ matrix.spec }}
check-latest: true
- name: The installed version is incorrect
if: matrix.expect && matrix.expect != steps.install.outputs.version
if: |
matrix.expect &&
matrix.expect != steps.install.outputs.nimskull-version
run: |
echo "::error::Expected version ${{ matrix.expect }} but got ${{ steps.install.outputs.version }}"
exit 1
Expand All @@ -64,7 +70,9 @@ jobs:

steps:
- name: Raise failure
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
if: |
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
run: |
echo "::error::There are failing required jobs"
exit 1
34 changes: 22 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,38 @@
#
# SPDX-License-Identifier: CC0-1.0

name: Setup Nimskull environment
description: Setup a Nimskull environment then add it to PATH
name: Setup Nimskull
description: Setup a Nimskull development environment
branding:
color: blue
icon: code

inputs:
token:
description: The Github token to retrieve data from nimskull repository
required: true
default: ${{ github.token }}
nimskull-version:
description: The semver specification for nimskull version to use. Defaults to any version
default: '*'
description:
The semver specification for nimskull version to use. Defaults to any
version
required: true
default: "*"
check-latest:
description: Whether to always check for the latest version satisfying the given spec. Defaults to true as nimskull is still in pre-alpha status.
default: true
description:
Whether to always check for the latest version satisfying the given spec.
Defaults to true as nimskull is still in pre-alpha status.
default: "true"
outputs:
path:
description: The resulting installation location
binPath:
bin-path:
description: Where binaries were installed
version:
description: The installed version
commit:
nimskull-version:
description: The installed nimskull version
nimskull-commit:
description: The commit of the compiler

runs:
using: 'node16'
main: 'dist/index.js'
using: "node20"
main: "dist/index.js"
Loading

0 comments on commit e372164

Please sign in to comment.