Skip to content

Commit ff4bf05

Browse files
committed
init action
0 parents  commit ff4bf05

File tree

8 files changed

+176
-0
lines changed

8 files changed

+176
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
calcit.cirru -diff linguist-generated
3+
yarn.lock -diff linguist-generated

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest]
20+
version: [ 0.8.38 ]
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Calcit
26+
uses: ./
27+
with:
28+
version: ${{ matrix.version }}
29+
30+
- name: Capture Calcit
31+
run: |
32+
cr --help
33+
caps --help
34+
cr -e "range 100"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
node_modules

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Action to setup Calcit
2+
3+
```yml
4+
TODO
5+
```

action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
name: setup-cr
3+
description: Setup Calcit runner
4+
inputs:
5+
version:
6+
description: Version of Calcit install
7+
required: true
8+
default: 0.8.38
9+
runs:
10+
using: node20
11+
main: index.js

index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const path = require("path");
2+
const core = require("@actions/core");
3+
const tc = require("@actions/tool-cache");
4+
5+
let getCrDownloadUrl = (version) => {
6+
return `https://github.com/calcit-lang/calcit/releases/download/${version}/cr`;
7+
};
8+
9+
let getCapsDownloadUrl = (version) => {
10+
return `https://github.com/calcit-lang/calcit/releases/download/${version}/caps`;
11+
};
12+
13+
async function setup() {
14+
try {
15+
// Get version of tool to be installed
16+
const version = core.getInput("version");
17+
18+
const pathToCr = await tc.downloadTool(getCrDownloadUrl(version));
19+
const pathToCaps = await tc.downloadTool(getCapsDownloadUrl(version));
20+
21+
// Expose the tool by adding it to the PATH
22+
core.addPath(pathToCr);
23+
core.addPath(pathToCaps);
24+
} catch (e) {
25+
core.setFailed(e);
26+
}
27+
}
28+
29+
module.exports = setup;
30+
31+
if (require.main === module) {
32+
setup();
33+
}

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "setup-cr",
3+
"version": "0.0.1",
4+
"description": "Setup Calcit runtime",
5+
"main": "./index.js",
6+
"repository": "[email protected]:calcit-lang/setup-cr.git",
7+
"author": "tiye <[email protected]>",
8+
"license": "MIT",
9+
"dependencies": {
10+
"@actions/core": "^1.10.1",
11+
"@actions/tool-cache": "^2.0.1"
12+
}
13+
}

yarn.lock

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)