2023-10-16 19:18:57 -05:00
|
|
|
# Example Workflow
|
2023-01-14 08:11:40 -06:00
|
|
|
|
|
|
|
```yaml
|
2023-02-21 23:34:44 -06:00
|
|
|
name: test
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-01-10 07:57:15 -06:00
|
|
|
- uses: jdx/mise-action@v2
|
2023-02-21 23:34:44 -06:00
|
|
|
with:
|
2024-01-02 16:16:49 -06:00
|
|
|
version: 2023.12.0 # [default: latest] mise version to install
|
|
|
|
install: true # [default: true] run `mise install`
|
|
|
|
cache: true # [default: true] cache mise using GitHub's cache
|
2023-12-14 07:56:58 -06:00
|
|
|
# automatically write this .tool-versions file
|
2023-12-24 20:15:25 +01:00
|
|
|
experimental: true # [default: false] enable experimental features
|
2023-02-21 23:34:44 -06:00
|
|
|
tool_versions: |
|
|
|
|
shellcheck 0.9.0
|
2024-01-02 16:16:49 -06:00
|
|
|
# or, if you prefer .mise.toml format:
|
|
|
|
mise_toml: |
|
2023-12-14 07:56:58 -06:00
|
|
|
[tools]
|
|
|
|
shellcheck = "0.9.0"
|
2023-02-21 23:34:44 -06:00
|
|
|
- run: shellcheck scripts/*.sh
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-01-02 16:16:49 -06:00
|
|
|
- uses: jdx/mise-action@v1
|
2023-02-21 23:34:44 -06:00
|
|
|
# .tool-versions will be read from repo root
|
|
|
|
- run: node ./my_app.js
|
2023-01-14 08:11:40 -06:00
|
|
|
```
|
2023-12-07 17:44:02 -06:00
|
|
|
|
2024-01-02 16:16:49 -06:00
|
|
|
Alternatively, mise is easy to use in GitHub Actions even without this:
|
2023-12-07 17:44:02 -06:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
steps:
|
2023-12-07 17:49:37 -06:00
|
|
|
- run: |
|
2024-01-02 16:16:49 -06:00
|
|
|
curl https://mise.jdx.dev/install.sh | sh
|
|
|
|
echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH
|
|
|
|
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
|
2023-12-07 17:44:02 -06:00
|
|
|
```
|