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
|
2023-08-27 12:12:44 -05:00
|
|
|
- uses: jdx/rtx-action@v1
|
2023-02-21 23:34:44 -06:00
|
|
|
with:
|
|
|
|
tool_versions: |
|
|
|
|
shellcheck 0.9.0
|
|
|
|
- run: shellcheck scripts/*.sh
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-08-27 12:12:44 -05:00
|
|
|
- uses: jdx/rtx-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
|
|
|
|
|
|
|
Alternatively, rtx is easy to use in GitHub Actions even without this:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
steps:
|
|
|
|
- run: curl https://rtx.pub/install.sh | sh && echo "$HOME/.local/share/rtx/bin/rtx" >> $GITHUB_PATH
|
|
|
|
```
|