-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start wrokflow for cep-85 * Typo * linting * Try memory trick ? * test * test * test * revert * test ci * Revert * Remove once_cell * update test context add drop * lint * test release * restructure project and update Makefile * update contract to export required items for testing * fix lints * simplify the cep85 mainfest * Unused imports * Update edition * TEst ci * test ci * test ci * test ci * test toolchain * Client yml * Add toolchain test ci * Remove release flag on test * Sorry for that Jan! --------- Co-authored-by: Fraser Hutchison <[email protected]> Co-authored-by: Fraser Hutchison <[email protected]>
- Loading branch information
1 parent
1dbd7c6
commit 74b3443
Showing
43 changed files
with
491 additions
and
189 deletions.
There are no files selected for viewing
This file contains 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,65 @@ | ||
name: ci-casper-cep-85-client | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'dev' | ||
- 'feat-*' | ||
- 'release-*' | ||
|
||
pull_request: | ||
branches: | ||
- 'dev' | ||
- 'feat-*' | ||
- 'release-*' | ||
|
||
jobs: | ||
client-build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
node-version: [20.x] | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2 | ||
|
||
- name: Swatinem cache | ||
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0 | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install -y build-essential wabt | ||
|
||
- name: Setup | ||
run: make prepare | ||
|
||
- name: Prepare WASMs | ||
run: make setup-test | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a #v3.4.0 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install | ||
working-directory: ./client-js | ||
run: npm install | ||
|
||
- name: Copy & convert WASMs | ||
working-directory: ./client-js | ||
run: npm run wasms:convert | ||
|
||
- name: Audits | ||
working-directory: ./client-js | ||
run: npm audit --omit=dev | ||
|
||
- name: Lints | ||
working-directory: ./client-js | ||
run: npm run lint | ||
|
||
- name: Test | ||
working-directory: ./client-js | ||
run: npm test |
This file contains 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,40 @@ | ||
name: ci-cep-85 | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'dev' | ||
- 'feat-*' | ||
- 'release-*' | ||
|
||
pull_request: | ||
branches: | ||
- 'dev' | ||
- 'feat-*' | ||
- 'release-*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2 | ||
|
||
- uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0 | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install -y build-essential wabt | ||
|
||
- name: Setup | ||
run: make prepare | ||
|
||
- name: Run clippy and fmt | ||
run: make check-lint | ||
|
||
- name: Run tests | ||
run: make test |
This file contains 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,41 @@ | ||
name: nightly-scheduled-test | ||
|
||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# runs every day at midnight | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
nightly-make-test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2 | ||
|
||
- uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0 | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install -y build-essential wabt | ||
|
||
- name: Setup | ||
run: make prepare | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
- name: Slack Notification | ||
uses: ravsamhq/notify-slack-action@4ed28566c2bdcdaee6dca2b46b9666d01b4ed8a4 #v1.10.0 | ||
if: always() | ||
with: | ||
status: ${{ job.status }} | ||
notification_title: '*{repo}*' | ||
message_format: '{emoji} *{workflow}* *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>' | ||
footer: '<{run_url}|View Run>' | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
|
||
- name: Fake Commit after 50 days | ||
uses: gautamkrishnar/keepalive-workflow@790c7f09285a59b09bb578c85e271c6ff2af97c4 #v1.1.0 |
This file contains 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,49 @@ | ||
name: publish-casper-cep85-client | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
node-version: [20.x] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2 | ||
|
||
- name: Swatinem cache | ||
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0 | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install -y build-essential wabt | ||
|
||
- name: Setup | ||
run: make prepare | ||
|
||
- name: Prepare WASMs | ||
run: make setup-test | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a #v3.4.0 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install | ||
working-directory: ./client-js | ||
run: npm install | ||
|
||
- name: Copy & convert WASMs | ||
working-directory: ./client-js | ||
run: npm run wasms:convert | ||
|
||
- name: Publish to NPM | ||
working-directory: ./client-js | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains 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,32 @@ | ||
name: publish-cep-85-contracts | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
publish-contract-tarball: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2 | ||
|
||
- uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0 | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install -y build-essential wabt | ||
|
||
- name: Setup | ||
run: make prepare | ||
|
||
- name: Build wasm contracts | ||
run: make build-contract | ||
|
||
- name: Create tarball | ||
run: ./ci/package_wasm.sh | ||
|
||
- name: Upload tarball to release | ||
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 #v2.3.0 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: /tmp/ci_package_wasm_${{ github.ref_name }}/cep-85-wasm.tar.gz |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
BUILD_ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd)" | ||
IGNORE='test_contract' | ||
WASM_FILE_PATH_ARRAY=($(cat "$BUILD_ROOT_DIR/Makefile" | grep 'wasm-strip' | awk -F' ' '{print $2}')) | ||
TAG=${GITHUB_REF_NAME:-local} | ||
TEMP_DIR="/tmp/ci_package_wasm_$TAG" | ||
TARBALL="cep-85-wasm.tar.gz" | ||
|
||
# Hygiene for local debugging. Won't apply to CI. | ||
if [ -d "$TEMP_DIR" ]; then | ||
rm -rf "$TEMP_DIR" | ||
fi | ||
|
||
# Create temporary directory for staging tarball | ||
mkdir -p "$TEMP_DIR" | ||
|
||
if [ -d "$TEMP_DIR" ]; then | ||
# Loop over the contracts | ||
for wasm_path in "${WASM_FILE_PATH_ARRAY[@]}"; do | ||
# Ignore test-contract, used only in testing | ||
if [[ "$wasm_path" != *"$IGNORE"* ]]; then | ||
# Copy the other wasm files if they exist | ||
if [ -f "$wasm_path" ]; then | ||
echo "copying $wasm_path to $TEMP_DIR" | ||
cp "$wasm_path" "$TEMP_DIR/" | ||
fi | ||
fi | ||
done | ||
|
||
# Move to the staging directory | ||
pushd "$TEMP_DIR" > /dev/null | ||
echo "" | ||
echo "creating $TEMP_DIR/$TARBALL" | ||
echo "" | ||
# create the tarball | ||
tar -czf "$TARBALL" *.wasm --remove-files | ||
# Move back | ||
popd > /dev/null | ||
fi | ||
|
||
echo "success!" |
This file contains 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 |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
"wasms:convert": "ts-node scripts/copy-and-convert-wasms.ts" | ||
}, | ||
"keywords": [], | ||
"author": "Jan Hoffmann <[email protected]>", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/jest": "^29.5.11", | ||
|
@@ -47,4 +46,4 @@ | |
"@make-software/ces-js-parser": "^1.3.3", | ||
"casper-js-sdk": "^2.15.3" | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains 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,17 @@ | ||
[workspace] | ||
members = ["cep85", "test"] | ||
resolver = "2" | ||
|
||
[workspace.package] | ||
edition = "2021" | ||
homepage = "https://casperlabs.io" | ||
license-file = "../LICENSE" | ||
readme = "../README.md" | ||
repository = "https://github.com/casper-ecosystem/cep-85" | ||
|
||
[workspace.dependencies] | ||
casper-types = "3.0.0" | ||
|
||
[profile.release] | ||
codegen-units = 1 | ||
lto = true |
Oops, something went wrong.