Skip to content

Commit 875f68b

Browse files
committed
refactor: restore Deno setup and use install.sh for Probitas installation
- Add back denoland/setup-deno for Deno runtime installation - Use install.sh from cli repo instead of direct deno install - Simplify test workflow: consolidate into single matrix job (3 OS × 2 versions) - Remove redundant test jobs (caching, no-cache, separate version tests)
1 parent 9b9994a commit 875f68b

File tree

2 files changed

+55
-42
lines changed

2 files changed

+55
-42
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,47 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
test-basic:
12-
name: Test Basic Setup
11+
test:
12+
name: Test (${{ matrix.os }}, ${{ matrix.probitas-version }})
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, macos-latest, windows-latest]
17+
probitas-version: [latest, 0.7.3]
1718
steps:
1819
- uses: actions/checkout@v4
1920

2021
- name: Setup Probitas
2122
uses: ./
2223
id: setup
24+
with:
25+
probitas-version: ${{ matrix.probitas-version }}
2326

2427
- name: Verify Outputs
2528
shell: bash
2629
run: |
30+
echo "Deno Version: ${{ steps.setup.outputs.deno-version }}"
2731
echo "Probitas Version: ${{ steps.setup.outputs.probitas-version }}"
2832
2933
- name: Test Probitas CLI
3034
run: |
3135
probitas --version
3236
probitas --help
3337
34-
- name: List probitas scenarios
35-
run: |
36-
probitas list
37-
38-
- name: Run probitas scenarios
38+
- name: Create Test Scenario
39+
shell: bash
3940
run: |
40-
probitas run
41-
42-
test-versions:
43-
name: Test Version Selection
44-
runs-on: ubuntu-latest
45-
strategy:
46-
matrix:
47-
probitas-version:
48-
- 0.7.3
49-
- latest
50-
steps:
51-
- uses: actions/checkout@v4
52-
53-
- name: Setup Probitas with ${{ matrix.probitas-version }}
54-
uses: ./
55-
with:
56-
probitas-version: ${{ matrix.probitas-version }}
57-
58-
- name: Verify Installation
59-
run: probitas --version
41+
mkdir -p probitas
42+
cat > probitas/test.probitas.ts << 'EOF'
43+
import { scenario } from "jsr:@probitas/probitas";
44+
45+
export default scenario("Test Scenario")
46+
.step("Hello", () => {
47+
console.log("Hello from Probitas!");
48+
return { success: true };
49+
})
50+
.build();
51+
EOF
52+
53+
- name: Run Probitas
54+
run: probitas run

action.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,67 @@
11
name: "Setup Probitas"
2-
description: "Setup Probitas by installing Probitas CLI and adding it to the path."
2+
description: "Setup Probitas by installing Deno and Probitas CLI, and adding them 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', 'rc', or 'stable'."
11+
default: "stable"
912
probitas-version:
1013
description: "The Probitas version to install. Can be a semver version or 'latest'."
1114
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."
1220

1321
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 }}
1428
probitas-version:
1529
description: "The Probitas version that was installed."
16-
value: ${{ steps.verify-probitas.outputs.probitas-version }}
30+
value: ${{ steps.install-probitas.outputs.probitas-version }}
1731

1832
runs:
1933
using: "composite"
2034
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+
2143
- name: Install Probitas CLI
2244
id: install-probitas
2345
shell: bash
2446
env:
2547
PROBITAS_VERSION: ${{ inputs.probitas-version != 'latest' && inputs.probitas-version || '' }}
26-
PROBITAS_INSTALL_DIR: ${{ runner.temp }}/probitas-bin
2748
run: |
2849
echo "Installing Probitas CLI${PROBITAS_VERSION:+ version $PROBITAS_VERSION}..."
29-
curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | bash
30-
31-
# Add to PATH
32-
echo "$PROBITAS_INSTALL_DIR" >> $GITHUB_PATH
50+
curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | sh
3351
34-
- name: Verify Probitas
35-
id: verify-probitas
36-
shell: bash
37-
env:
38-
PROBITAS_INSTALL_DIR: ${{ runner.temp }}/probitas-bin
39-
run: |
4052
# Verify installation
41-
if ! "$PROBITAS_INSTALL_DIR/probitas" --version &> /dev/null; then
53+
if ! command -v probitas &> /dev/null; then
4254
echo "Error: Probitas CLI installation failed"
4355
exit 1
4456
fi
4557
4658
# Get installed version
47-
INSTALLED_VERSION=$("$PROBITAS_INSTALL_DIR/probitas" --version 2>&1 | head -n 1)
59+
INSTALLED_VERSION=$(probitas --version 2>&1 | head -n 1)
4860
echo "Installed: $INSTALLED_VERSION"
4961
echo "probitas-version=$INSTALLED_VERSION" >> $GITHUB_OUTPUT
62+
63+
- name: Verify Probitas
64+
shell: bash
65+
run: |
66+
echo "Probitas CLI is ready:"
67+
probitas --version

0 commit comments

Comments
 (0)