-
Notifications
You must be signed in to change notification settings - Fork 2
Smoke test #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Smoke test #115
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0b3759f
Try smoke test
ernest-nowacki 55d0cf0
Potential fix for code scanning alert no. 17: Cache Poisoning via exe…
ernest-nowacki b6801a6
Update workflow to fix downloading cre cli
ernest-nowacki 791b874
Add better triggering
ernest-nowacki 0e1d8a9
fix on comment issue
ernest-nowacki b086e1d
Smoke test again
ernest-nowacki ae20ed9
Use proper binary name structure
ernest-nowacki 1c726e9
Merge branch 'main' of github.com:smartcontractkit/cre-sdk-typescript…
ernest-nowacki 3d38a41
Rework smoke test action to start small
ernest-nowacki 79ab9d2
Install zsh
ernest-nowacki a6b4586
Specifically state permissions and pin bun install action to commit
ernest-nowacki a12083f
Add full checks now instead of just lint
ernest-nowacki 4d646ba
Add rust toolchain installation
ernest-nowacki 206f42e
Make sure we do check out the submodules too
ernest-nowacki e1a2f09
Try installing CRE CLI and see if it would work on the CI
ernest-nowacki 38b0bba
Change the version we use for ubuntu-latest
ernest-nowacki 7ace272
Simulate the hello world workflow
ernest-nowacki 0d2bce9
Add a step to setup env variables
ernest-nowacki d8cfedd
Add proper key to simulate workflow using headless
ernest-nowacki 6d0e658
Add actual expectations
ernest-nowacki c2dd4fe
Try improving validation step to properly match expected outcome
ernest-nowacki dc04971
Make CRE CLI simulation part of CI checks
ernest-nowacki d84f7f1
Restore full-checks as a name to pass the required checks
ernest-nowacki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| name: Smoke Test | ||
| permissions: | ||
| contents: read | ||
| # optional but nice if you later want to react/post: pull-requests: write, issues: write | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| issue_comment: | ||
| types: [created] # run when a new comment is added | ||
|
|
||
| jobs: | ||
| smoke-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Run for normal PRs, OR when a PR comment contains '#smoke-test' | ||
| if: > | ||
| github.event_name == 'pull_request' || | ||
| (github.event_name == 'issue_comment' && | ||
| github.event.issue.pull_request != null && | ||
| contains(github.event.comment.body, '#smoke-test')) | ||
|
|
||
| steps: | ||
| # Checkout for regular PR trigger | ||
| - name: Checkout code (pull_request) | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| submodules: recursive | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # Checkout for comment trigger: use the PR head ref | ||
| - name: Checkout code (issue_comment on PR) | ||
| if: github.event_name == 'issue_comment' | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| submodules: recursive | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| # This checks out the PR head SHA for PR number in the comment event | ||
| ref: refs/pull/${{ github.event.issue.number }}/head | ||
|
|
||
| - name: Install system dependencies | ||
| 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 | ||
|
|
||
| # Make asdf available to subsequent steps without re-sourcing | ||
| echo "$HOME/.asdf/bin" >> $GITHUB_PATH | ||
| echo "$HOME/.asdf/shims" >> $GITHUB_PATH | ||
|
|
||
| # Init asdf | ||
| source ~/.asdf/asdf.sh | ||
|
|
||
| # Add plugins required for the project | ||
| asdf plugin add bun | ||
| asdf plugin add golang | ||
| asdf plugin add rust | ||
| asdf plugin add nodejs | ||
|
|
||
| # Install all versions pinned in .tool-versions | ||
| asdf install | ||
| asdf reshim | ||
|
|
||
| # Add Rust target for WASM (asdf-rust uses rustup under the hood) | ||
| rustup target add wasm32-wasip1 | ||
|
|
||
| - name: Install dependencies | ||
|
||
| run: bun install | ||
|
|
||
| - name: Run full checks | ||
|
||
| run: bun full-checks | ||
|
|
||
| - name: Download and install cre-cli (ubuntu-latest) | ||
|
||
| env: | ||
| CRE_CLI_TAG: v0.6.1-alpha.0 | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # Map runner arch to release naming | ||
| case "$(uname -m)" in | ||
| x86_64|amd64) ARCH=amd64 ;; | ||
| aarch64|arm64) ARCH=arm64 ;; | ||
| *) echo "Unsupported arch: $(uname -m)"; exit 1 ;; | ||
| esac | ||
|
|
||
| ASSET="cre_linux_${ARCH}.tar.gz" | ||
| BASE_URL="https://github.com/smartcontractkit/cre-cli/releases/download/${CRE_CLI_TAG}" | ||
|
|
||
| echo "Downloading ${ASSET} and checksums.txt from ${CRE_CLI_TAG}..." | ||
| curl -fL --retry 3 -o "${ASSET}" "${BASE_URL}/${ASSET}" | ||
| curl -fL --retry 3 -o checksums.txt "${BASE_URL}/checksums.txt" | ||
|
|
||
| echo "Verifying checksum..." | ||
| # checksums.txt contains lines like: "<sha256> <filename>" | ||
| grep " ${ASSET}$" checksums.txt > sha_line.txt | ||
| if [ ! -s sha_line.txt ]; then | ||
| echo "No checksum entry for ${ASSET}"; exit 1 | ||
| fi | ||
| sha256sum -c sha_line.txt | ||
|
|
||
| echo "Extracting..." | ||
| tar -xzf "${ASSET}" | ||
|
|
||
| # Find the 'cre' binary (tarball is expected to contain it at top-level) | ||
| BIN="./cre" | ||
| if [ ! -f "$BIN" ]; then | ||
| BIN="$(tar -tzf "${ASSET}" | grep -E '/?cre$' | head -n1 || true)" | ||
| [ -z "$BIN" ] && { echo "Could not locate 'cre' in archive"; exit 1; } | ||
| tar -xzf "${ASSET}" "$BIN" | ||
| fi | ||
|
|
||
| echo "Installing to /usr/local/bin..." | ||
| sudo mv ${BIN:-./cre} /usr/local/bin/cre | ||
| sudo chmod +x /usr/local/bin/cre | ||
|
|
||
| echo "Installed version:" | ||
| cre --version | ||
|
|
||
| - name: Setup CRE SDK examples | ||
| run: | | ||
| cd packages/cre-sdk-examples | ||
| bunx cre-setup | ||
|
|
||
| - name: Simulate Hello World workflow | ||
|
||
| run: | | ||
| cd packages/cre-sdk-examples | ||
| cre workflow simulate ./src/workflows/hello-world --target local-simulation | ||
|
|
||
| - name: Simulate Http Fetch workflow | ||
| run: | | ||
| cd packages/cre-sdk-examples | ||
| cre workflow simulate ./src/workflows/http-fetch --target local-simulation | ||
|
|
||
| - name: Simulate On Chain Read workflow | ||
| run: | | ||
| cd packages/cre-sdk-examples | ||
| cre workflow simulate ./src/workflows/on-chain --target local-simulation | ||
|
|
||
| - name: Simulate On Chain Write workflow | ||
| run: | | ||
| cd packages/cre-sdk-examples | ||
| cre workflow simulate ./src/workflows/on-chain-write --target local-simulation | ||
|
|
||
| - name: Simulate Proof of Reserve workflow | ||
| run: | | ||
| cd packages/cre-sdk-examples | ||
| cre workflow simulate ./src/workflows/proof-of-reserve --target local-simulation --secrets ../../../secrets.yaml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.