Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0b3759f
Try smoke test
ernest-nowacki Oct 3, 2025
55d0cf0
Potential fix for code scanning alert no. 17: Cache Poisoning via exe…
ernest-nowacki Oct 3, 2025
b6801a6
Update workflow to fix downloading cre cli
ernest-nowacki Oct 3, 2025
791b874
Add better triggering
ernest-nowacki Oct 3, 2025
0e1d8a9
fix on comment issue
ernest-nowacki Oct 3, 2025
b086e1d
Smoke test again
ernest-nowacki Oct 3, 2025
ae20ed9
Use proper binary name structure
ernest-nowacki Oct 3, 2025
1c726e9
Merge branch 'main' of github.com:smartcontractkit/cre-sdk-typescript…
ernest-nowacki Oct 8, 2025
3d38a41
Rework smoke test action to start small
ernest-nowacki Oct 8, 2025
79ab9d2
Install zsh
ernest-nowacki Oct 8, 2025
a6b4586
Specifically state permissions and pin bun install action to commit
ernest-nowacki Oct 8, 2025
a12083f
Add full checks now instead of just lint
ernest-nowacki Oct 8, 2025
4d646ba
Add rust toolchain installation
ernest-nowacki Oct 8, 2025
206f42e
Make sure we do check out the submodules too
ernest-nowacki Oct 8, 2025
e1a2f09
Try installing CRE CLI and see if it would work on the CI
ernest-nowacki Oct 8, 2025
38b0bba
Change the version we use for ubuntu-latest
ernest-nowacki Oct 8, 2025
7ace272
Simulate the hello world workflow
ernest-nowacki Oct 8, 2025
0d2bce9
Add a step to setup env variables
ernest-nowacki Oct 8, 2025
d8cfedd
Add proper key to simulate workflow using headless
ernest-nowacki Oct 8, 2025
6d0e658
Add actual expectations
ernest-nowacki Oct 8, 2025
c2dd4fe
Try improving validation step to properly match expected outcome
ernest-nowacki Oct 8, 2025
dc04971
Make CRE CLI simulation part of CI checks
ernest-nowacki Oct 8, 2025
d84f7f1
Restore full-checks as a name to pass the required checks
ernest-nowacki Oct 8, 2025
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
100 changes: 76 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,97 @@
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 system dependencies
- name: Install zsh
run: |
sudo apt-get update
sudo apt-get install -y make zsh curl libclang-dev git build-essential

- name: Install asdf and toolchain from .tool-versions
run: |
# Install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
sudo apt-get install -y zsh

# Make asdf available to subsequent steps without re-sourcing
echo "$HOME/.asdf/bin" >> $GITHUB_PATH
echo "$HOME/.asdf/shims" >> $GITHUB_PATH
# Add it to /etc/shells if missing
if ! grep -q "^$(which zsh)$" /etc/shells; then
echo "$(which zsh)" | sudo tee -a /etc/shells
fi

# Init asdf
source ~/.asdf/asdf.sh
# 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}

# Add plugins required for the project
asdf plugin add bun
asdf plugin add golang
asdf plugin add rust
asdf plugin add nodejs
# Install Rust + add wasm32-wasip1 target
- name: Setup Rust (stable) with wasm target
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c

Check warning on line 43 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. No version comment found (version-comment / warning)
with:
toolchain: stable
target: wasm32-wasip1
override: true

# Install all versions pinned in .tool-versions
asdf install
asdf reshim
- name: Setup Bun
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest

# Add Rust target for WASM (asdf-rust uses rustup under the hood)
rustup target add wasm32-wasip1
- 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
run: bun install --frozen-lockfile

- name: Run full checks
- 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!"
38 changes: 38 additions & 0 deletions scripts/setup-cre-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/zsh

# Exit on any error
set -e

# Configuration
VERSION="v0.6.2-alpha"
PLATFORM="linux_amd64"
FILENAME="cre_${PLATFORM}.tar.gz"
BINARY_NAME="cre_${VERSION}_${PLATFORM}"
DOWNLOAD_URL="https://github.com/smartcontractkit/cre-cli/releases/download/${VERSION}/${FILENAME}"
INSTALL_DIR="/usr/local/bin"

# Create temporary directory
TMP_DIR=$(mktemp -d)
trap "rm -rf ${TMP_DIR}" EXIT

echo "Downloading CRE CLI ${VERSION} for ${PLATFORM}..."
curl -L -o "${TMP_DIR}/${FILENAME}" "${DOWNLOAD_URL}"

echo "Extracting archive..."
tar -xzf "${TMP_DIR}/${FILENAME}" -C "${TMP_DIR}"

echo "Setting up binary..."
mv "${TMP_DIR}/${BINARY_NAME}" "${TMP_DIR}/cre"
chmod +x "${TMP_DIR}/cre"

echo "Installing to ${INSTALL_DIR}..."
# Use sudo if not running as root and installing to /usr/local/bin
if [ -w "${INSTALL_DIR}" ]; then
mv "${TMP_DIR}/cre" "${INSTALL_DIR}/cre"
else
sudo mv "${TMP_DIR}/cre" "${INSTALL_DIR}/cre"
fi

echo "CRE CLI installed successfully!"
echo "Verifying installation..."
cre --version || echo "Note: You may need to add ${INSTALL_DIR} to your PATH"
Loading