Skip to content
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

chore: update ckb deps for the upcoming ckb 2023 hardfork #1106

Merged
merged 9 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
84 changes: 49 additions & 35 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,91 @@
name: Scripts test
name: GWOS Scripts Tests

on:
merge_group:
types: [checks_requested]
push:
paths:
- 'gwos/**'
- 'crates/tests/src/script_tests/**'
- 'gwos/**'
- 'crates/tests/src/script_tests/**'
pull_request:
paths:
- 'gwos/**'
- 'crates/tests/src/script_tests/**'
- 'gwos/**'
- 'crates/tests/src/script_tests/**'

jobs:
build:
check-c-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Note: cargo fmt is done in .github/workflows/rust.yml
- name: Check format of gwos/c
working-directory: gwos/c
run: make fmt

runs-on: ubuntu-latest
build-gwos-and-test-scripts:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- name: Install Rust components
run: rustup component add rustfmt && rustup component add clippy
- uses: actions/cache@v3
with:
submodules: recursive

- name: Cache of Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-gwos-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cargo-gwos

- name: Install moleculec
working-directory: gwos
run: CARGO_TARGET_DIR=target/ cargo install moleculec --version 0.7.2
run: |
test "$(moleculec --version)" = "Moleculec 0.7.2" \
|| cargo install moleculec --version 0.7.2 --force
- name: Install capsule
env:
CAPSULE_VERSION: v0.7.0
run: curl -OL https://github.com/nervosnetwork/capsule/releases/download/${CAPSULE_VERSION}/capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz && tar xf capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz && echo `pwd`/capsule_${CAPSULE_VERSION}_x86_64-linux >> $GITHUB_PATH
- name: Check Tests format
run: cargo fmt --all -- --check
# - name: Check Rust format
# working-directory: gwos/contracts
# run: cargo fmt -- --check
- name: Check C format
working-directory: gwos/c
run: make fmt
- name: Init submodules
run: git submodule init && git submodule update -r
- name: Compile C contracts
run: |
(which capsule && test "$(capsule --version)" = "Capsule 0.7.0") \
|| curl -OL https://github.com/nervosnetwork/capsule/releases/download/${CAPSULE_VERSION}/capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& tar xf capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& mv capsule_${CAPSULE_VERSION}_x86_64-linux/capsule ~/.cargo/bin/ \
&& rm capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& rm -rf capsule_${CAPSULE_VERSION}_x86_64-linux/
capsule --version

- name: Compile C contracts of gwos
working-directory: gwos/c
run: make
#- name: Cargo clippy check
# env:
# RUSTFLAGS: -D warnings
# run: cd contracts && cargo clippy

- uses: actions/cache@v3
id: fetch-capsule-cache
with:
path: |
gwos/.tmp/capsule-cache.tar
key: ${{ runner.os }}-capsule-cache-${{ hashFiles('contracts/Cargo.lock') }}

- name: Restore capsule cache
if: steps.fetch-capsule-cache.outputs.cache-hit == 'true'
working-directory: gwos
run: tools/restore-capsule-cache.sh

- name: Build Rust contracts
working-directory: gwos
run: capsule build

- name: Backup capsule cache
if: steps.fetch-capsule-cache.outputs.cache-hit != 'true'
working-directory: gwos
run: tools/backup-capsule-cache.sh
# TODO: remove this
- name: Copy contracts from prebuild docker images
run: devtools/fetch-binaries.sh

- name: Test C Uint256
run: cargo test -p c-uint256-tests
- name: Script tests
Expand Down
Loading
Loading