Skip to content

Commit 2075419

Browse files
committed
refactor: switch to pre-compiled binary installation
Remove Deno dependency and use install.sh script to download pre-compiled Probitas CLI binary from GitHub releases instead of installing via JSR.
1 parent 6ff744a commit 2075419

File tree

2 files changed

+28
-98
lines changed

2 files changed

+28
-98
lines changed

README.md

Lines changed: 11 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# setup-probitas
22

3-
Set up your GitHub Actions workflow with [Probitas](https://github.com/jsr-probitas/probitas), a scenario-based testing framework for Deno.
3+
Set up your GitHub Actions workflow with [Probitas](https://github.com/jsr-probitas/probitas), a scenario-based testing framework.
44

55
## Usage
66

77
### Basic Setup
88

9-
The simplest setup installs the latest stable Deno and Probitas versions:
9+
The simplest setup installs the latest stable Probitas version:
1010

1111
```yaml
1212
- uses: jsr-probitas/setup-probitas@v1
@@ -30,10 +30,6 @@ jobs:
3030
- uses: actions/checkout@v4
3131

3232
- uses: jsr-probitas/setup-probitas@v1
33-
with:
34-
deno-version: 2.x
35-
probitas-version: latest
36-
cache: true
3733

3834
- name: Run Probitas tests
3935
run: probitas run
@@ -43,71 +39,41 @@ jobs:
4339
4440
| Input | Description | Default |
4541
|-------|-------------|---------|
46-
| `deno-version` | The Deno version to install. Can be a semver version (e.g., `2.0.0`, `2.x`), `canary`, `lts`, or a Git hash. | `2.x` |
47-
| `probitas-version` | The Probitas version to install from JSR. Can be a semver version or `latest`. | `latest` |
48-
| `cache` | Cache downloaded modules & packages automatically in GitHub Actions cache. | `true` |
49-
| `cache-hash` | A hash used as part of the cache key, which defaults to a hash of the deno.lock files. | - |
42+
| `probitas-version` | The Probitas version to install from GitHub releases. Can be a semver version or `latest`. | `latest` |
5043

5144
## Outputs
5245

5346
| Output | Description |
5447
|--------|-------------|
55-
| `cache-hit` | A boolean indicating whether the cache was hit. |
56-
| `deno-version` | The Deno version that was installed. |
5748
| `probitas-version` | The Probitas version that was installed. |
5849

5950
## Examples
6051

61-
### Specify Versions
62-
63-
```yaml
64-
- uses: jsr-probitas/setup-probitas@v1
65-
with:
66-
deno-version: "2.1.0"
67-
probitas-version: "0.1.0"
68-
```
69-
70-
### Use LTS Deno
52+
### Specify Version
7153

7254
```yaml
7355
- uses: jsr-probitas/setup-probitas@v1
7456
with:
75-
deno-version: lts
76-
```
77-
78-
### Disable Cache
79-
80-
```yaml
81-
- uses: jsr-probitas/setup-probitas@v1
82-
with:
83-
cache: false
84-
```
85-
86-
### Custom Cache Key
87-
88-
```yaml
89-
- uses: jsr-probitas/setup-probitas@v1
90-
with:
91-
cache-hash: ${{ hashFiles('**/deno.json', '**/deno.lock') }}
57+
probitas-version: "0.7.1"
9258
```
9359

9460
### Matrix Testing
9561

96-
Test across multiple Deno versions:
62+
Test across multiple Probitas versions:
9763

9864
```yaml
9965
jobs:
10066
test:
10167
runs-on: ubuntu-latest
10268
strategy:
10369
matrix:
104-
deno-version: ["2.x", lts, "2.0.0"]
70+
probitas-version: ["latest", "0.7.0", "0.7.1"]
10571
steps:
10672
- uses: actions/checkout@v4
10773
10874
- uses: jsr-probitas/setup-probitas@v1
10975
with:
110-
deno-version: ${{ matrix.deno-version }}
76+
probitas-version: ${{ matrix.probitas-version }}
11177
11278
- run: probitas run
11379
```
@@ -143,22 +109,8 @@ jobs:
143109

144110
This action performs the following steps:
145111

146-
1. **Setup Deno**: Uses [denoland/setup-deno](https://github.com/denoland/setup-deno) to install Deno with the specified version and cache configuration
147-
2. **Install Probitas CLI**: Installs the Probitas CLI from JSR using `deno install`
148-
3. **Verify Installation**: Confirms both Deno and Probitas are correctly installed and available in the PATH
149-
150-
## Caching
151-
152-
Caching is enabled by default and helps speed up your workflows by:
153-
154-
- Caching Deno's compiled module cache
155-
- Caching downloaded dependencies based on your `deno.lock` file
156-
- Reducing network requests and installation time
157-
158-
The cache key is automatically generated based on:
159-
- The GitHub job ID
160-
- The runner OS and architecture
161-
- A hash of `deno.lock` files in your project (customizable via `cache-hash`)
112+
1. **Install Probitas CLI**: Downloads and installs the pre-compiled Probitas CLI binary from GitHub releases
113+
2. **Verify Installation**: Confirms Probitas is correctly installed and available in the PATH
162114

163115
## Versioning
164116

@@ -185,7 +137,7 @@ Using `@v1` ensures you automatically receive bug fixes and new features within
185137
## Related Projects
186138

187139
- [Probitas](https://github.com/jsr-probitas/probitas) - The main Probitas framework
188-
- [setup-deno](https://github.com/denoland/setup-deno) - Deno setup action (used internally)
140+
- [Probitas CLI](https://github.com/jsr-probitas/cli) - The Probitas CLI
189141

190142
## License
191143

action.yml

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,49 @@
11
name: "Setup Probitas"
2-
description: "Setup Probitas by installing Deno and Probitas CLI, and adding them to the path."
2+
description: "Setup Probitas by installing Probitas CLI and adding it to the path."
33
author: "JSR Probitas"
44
branding:
55
icon: "check-circle"
66
color: "green"
77

88
inputs:
9-
deno-version:
10-
description: "The Deno version to install. Can be a semver version, 'canary', 'lts', or a Git hash."
11-
default: "2.x"
129
probitas-version:
1310
description: "The Probitas version to install. Can be a semver version or 'latest'."
1411
default: "latest"
15-
cache:
16-
description: "Cache downloaded modules & packages automatically in GitHub Actions cache."
17-
default: "true"
18-
cache-hash:
19-
description: "A hash used as part of the cache key, which defaults to a hash of the deno.lock files."
2012

2113
outputs:
22-
cache-hit:
23-
description: "A boolean indicating whether the cache was hit."
24-
value: ${{ steps.setup-deno.outputs.cache-hit }}
25-
deno-version:
26-
description: "The Deno version that was installed."
27-
value: ${{ steps.setup-deno.outputs.deno-version }}
2814
probitas-version:
2915
description: "The Probitas version that was installed."
30-
value: ${{ steps.install-probitas.outputs.probitas-version }}
16+
value: ${{ steps.verify-probitas.outputs.probitas-version }}
3117

3218
runs:
3319
using: "composite"
3420
steps:
35-
- name: Setup Deno
36-
id: setup-deno
37-
uses: denoland/setup-deno@v2
38-
with:
39-
deno-version: ${{ inputs.deno-version }}
40-
cache: ${{ inputs.cache }}
41-
cache-hash: ${{ inputs.cache-hash }}
42-
4321
- name: Install Probitas CLI
4422
id: install-probitas
4523
shell: bash
24+
env:
25+
PROBITAS_VERSION: ${{ inputs.probitas-version != 'latest' && inputs.probitas-version || '' }}
26+
PROBITAS_INSTALL_DIR: ${{ runner.temp }}/probitas-bin
4627
run: |
47-
if [ "${{ inputs.probitas-version }}" = "latest" ]; then
48-
VERSION_FLAG=""
49-
else
50-
VERSION_FLAG="@${{ inputs.probitas-version }}"
51-
fi
28+
echo "Installing Probitas CLI${PROBITAS_VERSION:+ version $PROBITAS_VERSION}..."
29+
curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | bash
5230
53-
echo "Installing Probitas CLI${VERSION_FLAG:+ version ${{ inputs.probitas-version }}}..."
54-
deno install -grAf -n probitas "jsr:@probitas/cli${VERSION_FLAG}"
31+
# Add to PATH
32+
echo "$PROBITAS_INSTALL_DIR" >> $GITHUB_PATH
5533
34+
- name: Verify Probitas
35+
id: verify-probitas
36+
shell: bash
37+
env:
38+
PROBITAS_INSTALL_DIR: ${{ runner.temp }}/probitas-bin
39+
run: |
5640
# Verify installation
57-
if ! command -v probitas &> /dev/null; then
41+
if ! "$PROBITAS_INSTALL_DIR/probitas" --version &> /dev/null; then
5842
echo "Error: Probitas CLI installation failed"
5943
exit 1
6044
fi
6145
6246
# Get installed version
63-
INSTALLED_VERSION=$(probitas --version 2>&1 | head -n 1)
47+
INSTALLED_VERSION=$("$PROBITAS_INSTALL_DIR/probitas" --version 2>&1 | head -n 1)
6448
echo "Installed: $INSTALLED_VERSION"
6549
echo "probitas-version=$INSTALLED_VERSION" >> $GITHUB_OUTPUT
66-
67-
- name: Verify Probitas
68-
shell: bash
69-
run: |
70-
echo "Probitas CLI is ready:"
71-
probitas --version

0 commit comments

Comments
 (0)