Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .github/workflows/check-dist.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: ci

on:
push:
branches: [main]
pull_request: {}

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Format the code
run: npm run format:check

- name: Lint the code
run: npm run lint

check-dist:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Rebuild the dist
run: npm run build

- name: Compare the expected and actual dist directories
run: |
if [ "$(git diff --ignore-space-at-eol ${{inputs.dist-path}} | wc -l)" -gt "0" ]; then
echo 'Some files needs to be rebuilt (`npm run build`). See the status below:' >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff --stat >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
exit 1
fi

test-v2:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v6

- name: Setup Risor
uses: ./
with:
version: latest

- name: Run Risor script
shell: risor {0}
run: |
let orders = [
{status: "pending", total: 10},
{status: "pending", total: 30},
{status: "completed", total: 550},
{status: "cancelled", total: 90},
{status: "pending", total: 5},
]

orders.filter(o => o.status == "pending").map(o => o.total).reduce(0, (a, b) => a + b)

test-v1:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v6

- name: Setup Risor
uses: ./
with:
version: v1.8.1

- name: Run Risor script
shell: risor {0}
run: |
array := ["gophers", "are", "burrowing", "rodents"]

sentence := array | strings.join(" ") | strings.to_upper

print(sentence)
19 changes: 0 additions & 19 deletions .github/workflows/prettier.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/test.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"tabWidth": 2,
"singleQuote": true,
"semi": true,
"printWidth": 100,
"experimentalSortPackageJson": false,
"ignorePatterns": ["dist"],
"overrides": [
{
"files": ["*.{yml,yaml}"],
"options": {
"singleQuote": false
}
}
]
}
10 changes: 10 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": ["dist"],
"categories": {
"correctness": "warn"
},
"rules": {
"eslint/no-unused-vars": "error"
}
}
1 change: 1 addition & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tabWidth: 2
singleQuote: true
semi: true
printWidth: 100

overrides:
- files: "*.{yml,yaml}"
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ steps:

- shell: risor {0}
run: |
array := ["gophers", "are", "burrowing", "rodents"]

sentence := array | strings.join(" ") | strings.to_upper

print(sentence)
let orders = [
{status: "pending", total: 10},
{status: "pending", total: 30},
{status: "completed", total: 550},
{status: "cancelled", total: 90},
{status: "pending", total: 5},
]

orders.filter(o => o.status == "pending").map(o => o.total).reduce(0, (a, b) => a + b)
```

## Caching
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ inputs:
required: true
default: "latest"
runs:
using: node20
using: node24
main: dist/index.js
Loading