Skip to content

Commit

Permalink
develop ci (#53)
Browse files Browse the repository at this point in the history
* Create develop_prepare.sh

* Update Makefile

* Create develop-ci.yml
  • Loading branch information
gpBlockchain authored Aug 6, 2024
1 parent 18c61ed commit 6ac9cbe
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/develop-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: develop ci

on:
schedule:
- cron: '0 0 */2 * *' # This triggers the workflow daily at midnight UTC
workflow_dispatch: # Allows the workflow to be manually triggered
inputs:
GitUrl:
description: 'ckb -git url'
default: 'https://github.com/nervosnetwork/ckb.git'
GitBranch:
description: 'ckb -git branch'
default: 'develop'

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install dependencies
run: make develop_prepare
env:
GitUrl: '${{ github.event.inputs.GitUrl }}'
GitBranch: '${{ github.event.inputs.GitBranch }}'


- name: Run tests
run: make test


- name: Publish reports
if: failure()
uses: actions/upload-artifact@v2
with:
name: jfoa-build-reports-${{ runner.os }}
path: ./report
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ prepare:
python3 -m download_ckb_light_client
echo "install ckb cli"
sh prepare.sh
develop_prepare:
python3 -m venv venv
. venv/bin/activate
python3 -m pip install --upgrade pip
pip install -r requirements.txt
echo "install ckb"
python3 -m download

python3 -m download_ckb_light_client
echo "install ckb cli"
sh develop_prepare.sh

test_cases := \
test_cases/replace_rpc \
Expand Down
19 changes: 19 additions & 0 deletions develop_prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set -e
# git clone https://github.com/nervosnetwork/ckb-cli.git
# cd ckb-cli
# git checkout pkg/v1.7.0
# make prod
# cp target/release/ckb-cli ../source/ckb-cli
# cd ../
DEFAULT_BRANCH="develop"
DEFAULT_URL="https://github.com/nervosnetwork/ckb.git"

GitBranch="${GitBranch:-$DEFAULT_BRANCH}"
GitUrl="${GitUrl:-$DEFAULT_URL}"

cp download/0.110.2/ckb-cli ./source/ckb-cli-old
cp download/0.117.0/ckb-cli ./source/ckb-cli
git clone -b $GitBranch $GitUrl
cd ckb
make prod
cp target/prod/ckb ../download/0.117.0/ckb

0 comments on commit 6ac9cbe

Please sign in to comment.