-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (87 loc) · 3.27 KB
/
ci.yml
File metadata and controls
108 lines (87 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: CI
permissions:
contents: read
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
jobs:
full-checks:
runs-on: ubuntu-latest
defaults:
run:
shell: zsh {0}
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install zsh
run: |
sudo apt-get update
sudo apt-get install -y zsh
# Add it to /etc/shells if missing
if ! grep -q "^$(which zsh)$" /etc/shells; then
echo "$(which zsh)" | sudo tee -a /etc/shells
fi
# Change the default shell for the current user
sudo chsh -s "$(which zsh)" $USER
# Use bash or sh for this step, because zsh isn't set yet
shell: bash {0}
# Install Rust + add wasm32-wasip1 target
- name: Setup Rust (stable) with wasm target
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
with:
toolchain: stable
target: wasm32-wasip1
override: true
- name: Setup Bun
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Full checks
run: bun full-checks
- name: Install CRE CLI
run: |
chmod +x scripts/setup-cre-cli.sh
sudo scripts/setup-cre-cli.sh
- name: Verify CRE CLI installation
run: cre version
- name: Simulate hello-world workflow
run: |
cd packages/cre-sdk-examples
cp .env.example .env
CRE_API_KEY=${{ secrets.CRE_CLI_API_KEY }} cre workflow simulate ./src/workflows/hello-world > simulation_output.txt 2>&1
cat simulation_output.txt
# Validate expected outputs
echo "Validating simulation output..."
if ! grep -q "USER LOG.*Hello world! Workflow triggered" simulation_output.txt; then
echo "❌ ERROR: Expected '[USER LOG] Hello world! Workflow triggered.' not found"
exit 1
fi
echo "✓ Found: [USER LOG] Hello world! Workflow triggered."
if ! grep -q 'Workflow Simulation Result:' simulation_output.txt; then
echo "❌ ERROR: Expected 'Workflow Simulation Result:' not found"
exit 1
fi
echo "✓ Found: Workflow Simulation Result:"
if ! grep -q '"Hello world!"' simulation_output.txt; then
echo "❌ ERROR: Expected '\"Hello world!\"' not found"
exit 1
fi
echo "✓ Found: \"Hello world!\""
if ! grep -q "Execution finished signal received" simulation_output.txt; then
echo "❌ ERROR: Expected 'Execution finished signal received' not found"
exit 1
fi
echo "✓ Found: Execution finished signal received"
echo "✅ All validation checks passed!"