From fa9fd1d568fed03964787cf98baa6c8810ffc5a6 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Tue, 16 May 2023 09:13:17 +1200 Subject: [PATCH 01/24] Changed VM to ubuntu latest --- .github/workflows/build-debian-11-binary.yml | 2 +- .github/workflows/build-ubuntu-2204-binary.yml | 2 +- .github/workflows/build-wasm.yml | 2 +- .github/workflows/run-tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-debian-11-binary.yml b/.github/workflows/build-debian-11-binary.yml index 2404f6c8..d3ae092d 100644 --- a/.github/workflows/build-debian-11-binary.yml +++ b/.github/workflows/build-debian-11-binary.yml @@ -12,7 +12,7 @@ jobs: secrets: inherit build: - runs-on: GP1-M + runs-on: ubuntu-latest name: Build Debian 11 Binary steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 51f6f198..d1aa0f65 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -12,7 +12,7 @@ jobs: secrets: inherit build: - runs-on: GP1-M + runs-on: ubuntu-latest name: Build Ubuntu 2204 Binary steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index d7fbb5f5..88d49b9f 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -21,7 +21,7 @@ jobs: secrets: inherit build: - runs-on: GP1-M + runs-on: ubuntu-latest name: Build WASM steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3ee4d7ad..23600540 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: secrets: inherit build: - runs-on: GP1-M + runs-on: ubuntu-latest name: Run Tests steps: - uses: actions/checkout@v3 From b76b08886fd98e9ddad2ce04413d58b795aa8f53 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Tue, 16 May 2023 21:28:30 +1200 Subject: [PATCH 02/24] Fixes ubuntu build 22.04 --- .../workflows/build-ubuntu-2204-binary.yml | 83 ++++++++++++++----- 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index d1aa0f65..4a277fab 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -1,35 +1,76 @@ -name: Build Ubuntu 22.04 Binary +# name: Build Ubuntu 22.04 Binary + +# on: +# workflow_dispatch: + +# env: +# CARGO_TERM_COLOR: always + +# jobs: +# call-start-new-build-machine: +# uses: ./.github/workflows/start-new-build-machine.yml +# secrets: inherit + +# build: +# runs-on: ubuntu-latest +# name: Build Ubuntu 2204 Binary +# steps: +# - uses: actions/checkout@v3 + +# - name: "Build DockerImage" +# run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . + +# - name: "Create output folder." +# run: mkdir output + +# - name: "Run Build Binary Script" +# run: podman run --rm -v ./output:/output -t tchain + +# - name: Upload Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: assets-for-download +# path: output +name: Build Pipeline on: workflow_dispatch: - -env: - CARGO_TERM_COLOR: always + inputs: + ubuntu_version: + description: 'Ubuntu Version' + required: true + default: '22.04' jobs: - call-start-new-build-machine: - uses: ./.github/workflows/start-new-build-machine.yml - secrets: inherit - build: runs-on: ubuntu-latest - name: Build Ubuntu 2204 Binary + name: Build Ubuntu 22.04 Binary steps: - - uses: actions/checkout@v3 + - name: Checkout Repository + uses: actions/checkout@v3 - - name: "Build DockerImage" - run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . + - name: Set up Podman + run: sudo apt-get update && sudo apt-get install -y podman - - name: "Create output folder." - run: mkdir output + - name: Build Podman Image + run: | + podman build \ + --platform linux/amd64 \ + --tag tchain \ + -f ./dockerimages/ubuntu-2204.Dockerfile . - - name: "Run Build Binary Script" - run: podman run --rm -v ./output:/output -t tchain + - name: Create Output Folder + run: mkdir output - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: assets-for-download - path: output + - name: Run Build Binary Script + run: | + podman run --rm \ + -v ${{ github.workspace }}/output:/output \ + -t tchain + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: assets-for-download + path: output \ No newline at end of file From 513c7029c977f33b7474fd7fb2cebc5ccc1c1cac Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Tue, 16 May 2023 22:36:55 +1200 Subject: [PATCH 03/24] Fixes ubuntu build 22.04 --- .../workflows/build-ubuntu-2204-binary.yml | 69 ++++++++++++++++--- 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 4a277fab..e94af7a8 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -31,7 +31,50 @@ # with: # name: assets-for-download # path: output -name: Build Pipeline +# name: Build Pipeline + +# on: +# workflow_dispatch: +# inputs: +# ubuntu_version: +# description: 'Ubuntu Version' +# required: true +# default: '22.04' + +# jobs: +# build: +# runs-on: ubuntu-latest +# name: Build Ubuntu 22.04 Binary +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v3 + +# - name: Set up Podman +# run: sudo apt-get update && sudo apt-get install -y podman + +# - name: Build Podman Image +# run: | +# podman build \ +# --platform linux/amd64 \ +# --tag tchain \ +# -f ./dockerimages/ubuntu-2204.Dockerfile . + +# - name: Create Output Folder +# run: mkdir output + +# - name: Run Build Binary Script +# run: | +# podman run --rm \ +# -v ${{ github.workspace }}/output:/output \ +# -t tchain + +# - name: Upload Artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: assets-for-download +# path: output + +name: Build Ubuntu 22.04 Binary on: workflow_dispatch: @@ -49,22 +92,31 @@ jobs: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up Podman - run: sudo apt-get update && sudo apt-get install -y podman + - name: Set up Docker + run: | + sudo apt-get update + sudo apt-get install -y docker.io + sudo groupadd docker || true + sudo usermod -aG docker $USER - - name: Build Podman Image + - name: Build Docker Image run: | - podman build \ + docker build \ --platform linux/amd64 \ --tag tchain \ - -f ./dockerimages/ubuntu-2204.Dockerfile . + -f ./dockerimages/ubuntu-2204.Dockerfile \ + --progress plain \ + --no-cache \ + --network=host . - name: Create Output Folder - run: mkdir output + run: | + mkdir output + sudo chown $USER output - name: Run Build Binary Script run: | - podman run --rm \ + docker run --rm \ -v ${{ github.workspace }}/output:/output \ -t tchain @@ -73,4 +125,3 @@ jobs: with: name: assets-for-download path: output - \ No newline at end of file From 3ce957e1349ca138551d3883d28f4c9123289607 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Tue, 16 May 2023 22:42:03 +1200 Subject: [PATCH 04/24] Fixes ubuntu build 22.04 --- .github/workflows/build-ubuntu-2204-binary.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index e94af7a8..d2c4bc55 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -92,22 +92,19 @@ jobs: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up Docker + - name: Set up Podman run: | sudo apt-get update - sudo apt-get install -y docker.io - sudo groupadd docker || true - sudo usermod -aG docker $USER + sudo apt-get install -y podman - - name: Build Docker Image + - name: Build Podman Image run: | - docker build \ + podman build \ --platform linux/amd64 \ --tag tchain \ -f ./dockerimages/ubuntu-2204.Dockerfile \ - --progress plain \ - --no-cache \ - --network=host . + --log-level debug \ + --events-backend file - name: Create Output Folder run: | @@ -116,7 +113,7 @@ jobs: - name: Run Build Binary Script run: | - docker run --rm \ + podman run --rm \ -v ${{ github.workspace }}/output:/output \ -t tchain From fe845b8564c4b03d87c0303ef3c612a06a3e5815 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Tue, 16 May 2023 22:51:17 +1200 Subject: [PATCH 05/24] Fixes ubuntu build 22.04 --- .../workflows/build-ubuntu-2204-binary.yml | 143 +++++++++--------- 1 file changed, 72 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index d2c4bc55..355e76e4 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -1,36 +1,37 @@ -# name: Build Ubuntu 22.04 Binary +name: Build Ubuntu 22.04 Binary -# on: -# workflow_dispatch: +on: + workflow_dispatch: -# env: -# CARGO_TERM_COLOR: always +env: + CARGO_TERM_COLOR: always -# jobs: -# call-start-new-build-machine: -# uses: ./.github/workflows/start-new-build-machine.yml -# secrets: inherit +jobs: + call-start-new-build-machine: + uses: ./.github/workflows/start-new-build-machine.yml + secrets: inherit -# build: -# runs-on: ubuntu-latest -# name: Build Ubuntu 2204 Binary -# steps: -# - uses: actions/checkout@v3 + build: + runs-on: ubuntu-latest + name: Build Ubuntu 2204 Binary + steps: + - uses: actions/checkout@v3 -# - name: "Build DockerImage" -# run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . + - name: "Build DockerImage" + run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . -# - name: "Create output folder." -# run: mkdir output + - name: "Create output folder." + run: mkdir output -# - name: "Run Build Binary Script" -# run: podman run --rm -v ./output:/output -t tchain + - name: "Run Build Binary Script" + run: podman run --rm -v ./output:/output -t tchain -# - name: Upload Artifacts -# uses: actions/upload-artifact@v3 -# with: -# name: assets-for-download -# path: output + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: assets-for-download + path: output + # name: Build Pipeline # on: @@ -74,51 +75,51 @@ # name: assets-for-download # path: output -name: Build Ubuntu 22.04 Binary +# name: Build Ubuntu 22.04 Binary -on: - workflow_dispatch: - inputs: - ubuntu_version: - description: 'Ubuntu Version' - required: true - default: '22.04' +# on: +# workflow_dispatch: +# inputs: +# ubuntu_version: +# description: 'Ubuntu Version' +# required: true +# default: '22.04' -jobs: - build: - runs-on: ubuntu-latest - name: Build Ubuntu 22.04 Binary - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - - name: Set up Podman - run: | - sudo apt-get update - sudo apt-get install -y podman - - - name: Build Podman Image - run: | - podman build \ - --platform linux/amd64 \ - --tag tchain \ - -f ./dockerimages/ubuntu-2204.Dockerfile \ - --log-level debug \ - --events-backend file - - - name: Create Output Folder - run: | - mkdir output - sudo chown $USER output - - - name: Run Build Binary Script - run: | - podman run --rm \ - -v ${{ github.workspace }}/output:/output \ - -t tchain - - - name: Upload Artifacts - uses: actions/upload-artifact@v2 - with: - name: assets-for-download - path: output +# jobs: +# build: +# runs-on: ubuntu-latest +# name: Build Ubuntu 22.04 Binary +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v3 + +# - name: Set up Podman +# run: | +# sudo apt-get update +# sudo apt-get install -y podman + +# - name: Build Podman Image +# run: | +# podman build \ +# --platform linux/amd64 \ +# --tag tchain \ +# -f ./dockerimages/ubuntu-2204.Dockerfile \ +# --log-level debug \ +# --events-backend file + +# - name: Create Output Folder +# run: | +# mkdir output +# sudo chown $USER output + +# - name: Run Build Binary Script +# run: | +# podman run --rm \ +# -v ${{ github.workspace }}/output:/output \ +# -t tchain + +# - name: Upload Artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: assets-for-download +# path: output From 42e5182a31ffa9aac214ba151e07fcde77e3bed0 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Tue, 16 May 2023 23:35:43 +1200 Subject: [PATCH 06/24] Fixes ubuntu build 22.04 --- .../workflows/build-ubuntu-2204-binary.yml | 54 ++++--------------- 1 file changed, 10 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 355e76e4..7a282190 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -2,6 +2,11 @@ name: Build Ubuntu 22.04 Binary on: workflow_dispatch: + inputs: + ubuntu_version: + description: 'Ubuntu Version' + required: true + default: '22.04' env: CARGO_TERM_COLOR: always @@ -21,7 +26,11 @@ jobs: run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . - name: "Create output folder." - run: mkdir output + # run: mkdir output + # - name: Create Output Folder + run: | + mkdir output + sudo chown $USER output - name: "Run Build Binary Script" run: podman run --rm -v ./output:/output -t tchain @@ -31,49 +40,6 @@ jobs: with: name: assets-for-download path: output - -# name: Build Pipeline - -# on: -# workflow_dispatch: -# inputs: -# ubuntu_version: -# description: 'Ubuntu Version' -# required: true -# default: '22.04' - -# jobs: -# build: -# runs-on: ubuntu-latest -# name: Build Ubuntu 22.04 Binary -# steps: -# - name: Checkout Repository -# uses: actions/checkout@v3 - -# - name: Set up Podman -# run: sudo apt-get update && sudo apt-get install -y podman - -# - name: Build Podman Image -# run: | -# podman build \ -# --platform linux/amd64 \ -# --tag tchain \ -# -f ./dockerimages/ubuntu-2204.Dockerfile . - -# - name: Create Output Folder -# run: mkdir output - -# - name: Run Build Binary Script -# run: | -# podman run --rm \ -# -v ${{ github.workspace }}/output:/output \ -# -t tchain - -# - name: Upload Artifacts -# uses: actions/upload-artifact@v2 -# with: -# name: assets-for-download -# path: output # name: Build Ubuntu 22.04 Binary From 50a738750b06491faa560062f06cff0f89c0e0b7 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 09:29:09 +1200 Subject: [PATCH 07/24] Fixes ubuntu build 22.04 --- .../workflows/build-ubuntu-2204-binary.yml | 61 +++++++++++++++---- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 7a282190..9e19ea8d 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -2,23 +2,18 @@ name: Build Ubuntu 22.04 Binary on: workflow_dispatch: - inputs: - ubuntu_version: - description: 'Ubuntu Version' - required: true - default: '22.04' env: CARGO_TERM_COLOR: always jobs: - call-start-new-build-machine: - uses: ./.github/workflows/start-new-build-machine.yml - secrets: inherit build: runs-on: ubuntu-latest name: Build Ubuntu 2204 Binary + container: + image: ubuntu:22.04 + steps: - uses: actions/checkout@v3 @@ -26,11 +21,7 @@ jobs: run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . - name: "Create output folder." - # run: mkdir output - # - name: Create Output Folder - run: | - mkdir output - sudo chown $USER output + run: mkdir output - name: "Run Build Binary Script" run: podman run --rm -v ./output:/output -t tchain @@ -41,6 +32,50 @@ jobs: name: assets-for-download path: output + +# name: Build Ubuntu 22.04 Binary + +# on: +# workflow_dispatch: +# inputs: +# ubuntu_version: +# description: 'Ubuntu Version' +# required: true +# default: '22.04' + +# env: +# CARGO_TERM_COLOR: always + +# jobs: +# call-start-new-build-machine: +# uses: ./.github/workflows/start-new-build-machine.yml +# secrets: inherit + +# build: +# runs-on: ubuntu-latest +# name: Build Ubuntu 2204 Binary +# steps: +# - uses: actions/checkout@v3 + +# - name: "Build DockerImage" +# run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . + +# - name: "Create output folder." +# # run: mkdir output +# # - name: Create Output Folder +# run: | +# mkdir output +# sudo chown $USER output + +# - name: "Run Build Binary Script" +# run: podman run --rm -v ./output:/output -t tchain + +# - name: Upload Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: assets-for-download +# path: output + # name: Build Ubuntu 22.04 Binary # on: From b3f2beff3e5af888a5aa287634b1dd9a5d3c514c Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 09:33:59 +1200 Subject: [PATCH 08/24] Fixes ubuntu build 22.04 --- .github/workflows/build-ubuntu-2204-binary.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 9e19ea8d..9bff49f3 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -11,9 +11,6 @@ jobs: build: runs-on: ubuntu-latest name: Build Ubuntu 2204 Binary - container: - image: ubuntu:22.04 - steps: - uses: actions/checkout@v3 From 540bf1ba7feecc4fd57d24d12c6813c6c66f9804 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 13:45:53 +1200 Subject: [PATCH 09/24] Separate Build --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6192439e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI +on: + workflow_dispatch +jobs: + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # cancel concurrent builds on the same branch + concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get submodules + run: git submodule update --init --recursive + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-24 + components: rustfmt, llvm-tools-preview + target: wasm32-unknown-unknown + default: true + + - name: Cache restore + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Clean + if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} + run: cargo clean + + - name: Check format + run: cargo fmt --all -- --check + + - name: Check release + run: cargo check --release + + - name: Build + run: cargo build --locked --release From b1f4e2ab3b4ed0788a3af0ea189834c7c36badf1 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 13:48:10 +1200 Subject: [PATCH 10/24] Separate Build --- .../workflows/build-ubuntu-2204-binary.yml | 222 +++++++++++------- 1 file changed, 138 insertions(+), 84 deletions(-) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 9bff49f3..feaaf7b8 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -1,52 +1,66 @@ name: Build Ubuntu 22.04 Binary - on: - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always - + workflow_dispatch jobs: - build: + # The type of runner that the job will run on runs-on: ubuntu-latest - name: Build Ubuntu 2204 Binary - steps: - - uses: actions/checkout@v3 - - name: "Build DockerImage" - run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . + # cancel concurrent builds on the same branch + concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true - - name: "Create output folder." - run: mkdir output - - - name: "Run Build Binary Script" - run: podman run --rm -v ./output:/output -t tchain + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get submodules + run: git submodule update --init --recursive + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-24 + components: rustfmt, llvm-tools-preview + target: wasm32-unknown-unknown + default: true + + - name: Cache restore + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Clean + if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} + run: cargo clean + + - name: Check format + run: cargo fmt --all -- --check + + - name: Check release + run: cargo check --release + + - name: Build + run: cargo build --locked --release - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: assets-for-download - path: output - # name: Build Ubuntu 22.04 Binary # on: # workflow_dispatch: -# inputs: -# ubuntu_version: -# description: 'Ubuntu Version' -# required: true -# default: '22.04' # env: # CARGO_TERM_COLOR: always # jobs: -# call-start-new-build-machine: -# uses: ./.github/workflows/start-new-build-machine.yml -# secrets: inherit # build: # runs-on: ubuntu-latest @@ -58,11 +72,7 @@ jobs: # run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . # - name: "Create output folder." -# # run: mkdir output -# # - name: Create Output Folder -# run: | -# mkdir output -# sudo chown $USER output +# run: mkdir output # - name: "Run Build Binary Script" # run: podman run --rm -v ./output:/output -t tchain @@ -73,51 +83,95 @@ jobs: # name: assets-for-download # path: output -# name: Build Ubuntu 22.04 Binary - -# on: -# workflow_dispatch: -# inputs: -# ubuntu_version: -# description: 'Ubuntu Version' -# required: true -# default: '22.04' - -# jobs: -# build: -# runs-on: ubuntu-latest -# name: Build Ubuntu 22.04 Binary -# steps: -# - name: Checkout Repository -# uses: actions/checkout@v3 - -# - name: Set up Podman -# run: | -# sudo apt-get update -# sudo apt-get install -y podman - -# - name: Build Podman Image -# run: | -# podman build \ -# --platform linux/amd64 \ -# --tag tchain \ -# -f ./dockerimages/ubuntu-2204.Dockerfile \ -# --log-level debug \ -# --events-backend file - -# - name: Create Output Folder -# run: | -# mkdir output -# sudo chown $USER output - -# - name: Run Build Binary Script -# run: | -# podman run --rm \ -# -v ${{ github.workspace }}/output:/output \ -# -t tchain - -# - name: Upload Artifacts -# uses: actions/upload-artifact@v2 -# with: -# name: assets-for-download -# path: output + +# # name: Build Ubuntu 22.04 Binary + +# # on: +# # workflow_dispatch: +# # inputs: +# # ubuntu_version: +# # description: 'Ubuntu Version' +# # required: true +# # default: '22.04' + +# # env: +# # CARGO_TERM_COLOR: always + +# # jobs: +# # call-start-new-build-machine: +# # uses: ./.github/workflows/start-new-build-machine.yml +# # secrets: inherit + +# # build: +# # runs-on: ubuntu-latest +# # name: Build Ubuntu 2204 Binary +# # steps: +# # - uses: actions/checkout@v3 + +# # - name: "Build DockerImage" +# # run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . + +# # - name: "Create output folder." +# # # run: mkdir output +# # # - name: Create Output Folder +# # run: | +# # mkdir output +# # sudo chown $USER output + +# # - name: "Run Build Binary Script" +# # run: podman run --rm -v ./output:/output -t tchain + +# # - name: Upload Artifacts +# # uses: actions/upload-artifact@v3 +# # with: +# # name: assets-for-download +# # path: output + +# # name: Build Ubuntu 22.04 Binary + +# # on: +# # workflow_dispatch: +# # inputs: +# # ubuntu_version: +# # description: 'Ubuntu Version' +# # required: true +# # default: '22.04' + +# # jobs: +# # build: +# # runs-on: ubuntu-latest +# # name: Build Ubuntu 22.04 Binary +# # steps: +# # - name: Checkout Repository +# # uses: actions/checkout@v3 + +# # - name: Set up Podman +# # run: | +# # sudo apt-get update +# # sudo apt-get install -y podman + +# # - name: Build Podman Image +# # run: | +# # podman build \ +# # --platform linux/amd64 \ +# # --tag tchain \ +# # -f ./dockerimages/ubuntu-2204.Dockerfile \ +# # --log-level debug \ +# # --events-backend file + +# # - name: Create Output Folder +# # run: | +# # mkdir output +# # sudo chown $USER output + +# # - name: Run Build Binary Script +# # run: | +# # podman run --rm \ +# # -v ${{ github.workspace }}/output:/output \ +# # -t tchain + +# # - name: Upload Artifacts +# # uses: actions/upload-artifact@v2 +# # with: +# # name: assets-for-download +# # path: output From 6df2446a36b4b567d9e06fc7543113106b6346b5 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 14:05:08 +1200 Subject: [PATCH 11/24] install protoc --- .github/workflows/build-ubuntu-2204-binary.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index feaaf7b8..092b3b3e 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -27,6 +27,11 @@ jobs: target: wasm32-unknown-unknown default: true + - name: Install protoc + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler + - name: Cache restore uses: actions/cache@v3 with: From 2a1637d90081878289e67ca5eafbdc1994fc12e6 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 15:10:37 +1200 Subject: [PATCH 12/24] debian build without docker --- .github/workflows/build-debian-11-binary.yml | 99 ++++++++++++++----- .../workflows/build-ubuntu-2204-binary.yml | 72 ++++++++++++-- 2 files changed, 139 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-debian-11-binary.yml b/.github/workflows/build-debian-11-binary.yml index d3ae092d..48d0c350 100644 --- a/.github/workflows/build-debian-11-binary.yml +++ b/.github/workflows/build-debian-11-binary.yml @@ -1,35 +1,88 @@ name: Build Debian 11 Binary - on: - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always + workflow_dispatch jobs: - call-start-new-build-machine: - uses: ./.github/workflows/start-new-build-machine.yml - secrets: inherit - build: - runs-on: ubuntu-latest - name: Build Debian 11 Binary + runs-on: debian-11 + steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get submodules + run: git submodule update --init --recursive + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-24 + components: rustfmt, llvm-tools-preview + target: wasm32-unknown-unknown + default: true + + - name: Install protoc + run: | + sudo apt update + sudo apt install -y protobuf-compiler + + - name: Cache restore + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Clean + if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} + run: cargo clean + + - name: Check format + run: cargo fmt --all -- --check + + - name: Check release + run: cargo check --release + + - name: Build + run: cargo build --locked --release + +# name: Build Debian 11 Binary + +# on: +# workflow_dispatch: + +# env: +# CARGO_TERM_COLOR: always + +# jobs: +# call-start-new-build-machine: +# uses: ./.github/workflows/start-new-build-machine.yml +# secrets: inherit + +# build: +# runs-on: ubuntu-latest +# name: Build Debian 11 Binary +# steps: +# - uses: actions/checkout@v3 - - name: "Build DockerImage" - run: podman build -t tchain -f ./dockerimages/debian-11.Dockerfile . +# - name: "Build DockerImage" +# run: podman build -t tchain -f ./dockerimages/debian-11.Dockerfile . - - name: "Create output folder." - run: mkdir output +# - name: "Create output folder." +# run: mkdir output - - name: "Run Build Binary Script" - run: podman run --rm -v ./output:/output -t tchain +# - name: "Run Build Binary Script" +# run: podman run --rm -v ./output:/output -t tchain - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: assets-for-download - path: output +# - name: Upload Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: assets-for-download +# path: output \ No newline at end of file diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 092b3b3e..4f7de3b6 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -1,20 +1,15 @@ name: Build Ubuntu 22.04 Binary on: - workflow_dispatch + workflow_dispatch + jobs: build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # cancel concurrent builds on the same branch - concurrency: - group: ${{ github.head_ref || github.run_id }} - cancel-in-progress: true + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Get submodules run: git submodule update --init --recursive @@ -57,6 +52,65 @@ jobs: run: cargo build --locked --release +# name: Build Ubuntu 22.04 Binary +# on: +# workflow_dispatch +# jobs: +# build: +# # The type of runner that the job will run on +# runs-on: ubuntu-latest + +# # cancel concurrent builds on the same branch +# concurrency: +# group: ${{ github.head_ref || github.run_id }} +# cancel-in-progress: true + +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 + +# - name: Get submodules +# run: git submodule update --init --recursive + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2022-04-24 +# components: rustfmt, llvm-tools-preview +# target: wasm32-unknown-unknown +# default: true + +# - name: Install protoc +# run: | +# sudo apt-get update +# sudo apt-get install -y protobuf-compiler + +# - name: Cache restore +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cargo/bin/ +# ~/.cargo/registry/index/ +# ~/.cargo/registry/cache/ +# ~/.cargo/git/db/ +# target/ +# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + +# - name: Clean +# if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} +# run: cargo clean + +# - name: Check format +# run: cargo fmt --all -- --check + +# - name: Check release +# run: cargo check --release + +# - name: Build +# run: cargo build --locked --release + + # name: Build Ubuntu 22.04 Binary # on: From e6b33057f5203e238c6ac69444039560d7a1cc21 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 15:13:28 +1200 Subject: [PATCH 13/24] debian unsupported --- .github/workflows/build-debian-11-binary.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-debian-11-binary.yml b/.github/workflows/build-debian-11-binary.yml index 48d0c350..ad90e368 100644 --- a/.github/workflows/build-debian-11-binary.yml +++ b/.github/workflows/build-debian-11-binary.yml @@ -4,7 +4,9 @@ on: jobs: build: - runs-on: debian-11 + # no support for debian-11 yet + runs-on: ubuntu-22.04 + # runs-on: debian-11 steps: - name: Checkout code From 3be130f40693c3a93e3c6fb9cfb056b61a23e78f Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Wed, 17 May 2023 15:25:26 +1200 Subject: [PATCH 14/24] Added web assembly artefact --- .github/workflows/build-ubuntu-2204-binary.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index 4f7de3b6..f45685f3 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -51,7 +51,17 @@ jobs: - name: Build run: cargo build --locked --release + - name: Upload Artifacts Alphanet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-alphanet + path: target/release/wbuild/alphanet-runtime/alphanet_runtime.compact.compressed.wasm + - name: Upload Artifacts Mainnet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-mainnet + path: target/release/wbuild/mainnet-runtime/mainnet_runtime.compact.compressed.wasm # name: Build Ubuntu 22.04 Binary # on: # workflow_dispatch From b59610efe1be9efb4ed7e4196196cc9a501ede82 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 08:32:07 +1200 Subject: [PATCH 15/24] Debian Build --- .github/workflows/build-debian-11-binary.yml | 131 ++++++++++++------- 1 file changed, 83 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build-debian-11-binary.yml b/.github/workflows/build-debian-11-binary.yml index ad90e368..bdd9457c 100644 --- a/.github/workflows/build-debian-11-binary.yml +++ b/.github/workflows/build-debian-11-binary.yml @@ -1,57 +1,92 @@ name: Build Debian 11 Binary + on: - workflow_dispatch + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always jobs: - build: - # no support for debian-11 yet - runs-on: ubuntu-22.04 - # runs-on: debian-11 + call-start-new-build-machine: + uses: ./.github/workflows/start-new-build-machine.yml + secrets: inherit + build: + runs-on: GP1-M + name: Build Debian 11 Binary steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Get submodules - run: git submodule update --init --recursive - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2022-04-24 - components: rustfmt, llvm-tools-preview - target: wasm32-unknown-unknown - default: true - - - name: Install protoc - run: | - sudo apt update - sudo apt install -y protobuf-compiler - - - name: Cache restore - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Clean - if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} - run: cargo clean - - - name: Check format - run: cargo fmt --all -- --check - - - name: Check release - run: cargo check --release - - - name: Build - run: cargo build --locked --release + - uses: actions/checkout@v3 + + - name: "Build DockerImage" + run: podman build -t tchain -f ./dockerimages/debian-11.Dockerfile . + + - name: "Create output folder." + run: mkdir output + + - name: "Run Build Binary Script" + run: podman run --rm -v ./output:/output -t tchain + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: assets-for-download + path: output + + +# name: Build Debian 11 Binary +# on: +# workflow_dispatch + +# jobs: +# build: +# # no support for debian-11 yet +# runs-on: ubuntu-22.04 +# # runs-on: debian-11 + +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 + +# - name: Get submodules +# run: git submodule update --init --recursive + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2022-04-24 +# components: rustfmt, llvm-tools-preview +# target: wasm32-unknown-unknown +# default: true + +# - name: Install protoc +# run: | +# sudo apt update +# sudo apt install -y protobuf-compiler + +# - name: Cache restore +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cargo/bin/ +# ~/.cargo/registry/index/ +# ~/.cargo/registry/cache/ +# ~/.cargo/git/db/ +# target/ +# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + +# - name: Clean +# if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} +# run: cargo clean + +# - name: Check format +# run: cargo fmt --all -- --check + +# - name: Check release +# run: cargo check --release + +# - name: Build +# run: cargo build --locked --release # name: Build Debian 11 Binary From 37183ef3a8f976c03fcf06636b4a6af32628efa3 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 08:39:49 +1200 Subject: [PATCH 16/24] Debian Build --- .github/scripts/read-scw-machines.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/read-scw-machines.py b/.github/scripts/read-scw-machines.py index fd298c03..c107d467 100644 --- a/.github/scripts/read-scw-machines.py +++ b/.github/scripts/read-scw-machines.py @@ -26,6 +26,7 @@ def is_ok(config, runner): config = sys.argv[1] data = json.load(sys.stdin) +print(data) to_turn_off = [] for runner in data["runners"]: if (not is_ok(config, runner)): From c618d9e3957c4d81cbe96e03ac87f03b775f0029 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 08:48:24 +1200 Subject: [PATCH 17/24] Debian Build --- .github/scripts/read-scw-machines.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/read-scw-machines.py b/.github/scripts/read-scw-machines.py index c107d467..54d88f5d 100644 --- a/.github/scripts/read-scw-machines.py +++ b/.github/scripts/read-scw-machines.py @@ -26,7 +26,8 @@ def is_ok(config, runner): config = sys.argv[1] data = json.load(sys.stdin) -print(data) +print('config: ' + config) +print('data: ' + data) to_turn_off = [] for runner in data["runners"]: if (not is_ok(config, runner)): From 35ea014be382970fb24d7895029e166a1480c7e6 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 08:52:21 +1200 Subject: [PATCH 18/24] Debian Build --- .github/scripts/read-scw-machines.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/read-scw-machines.py b/.github/scripts/read-scw-machines.py index 54d88f5d..939ae130 100644 --- a/.github/scripts/read-scw-machines.py +++ b/.github/scripts/read-scw-machines.py @@ -26,8 +26,10 @@ def is_ok(config, runner): config = sys.argv[1] data = json.load(sys.stdin) +print('--------------------') print('config: ' + config) -print('data: ' + data) +print( data) +print('--------------------') to_turn_off = [] for runner in data["runners"]: if (not is_ok(config, runner)): From e923283fbf1a7bf8dec25cd2eb225ab61be2c27a Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 11:12:35 +1200 Subject: [PATCH 19/24] Dedicated workflow when making a PR to main branch --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6192439e..b0a106dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,18 @@ -name: CI +name: Ternoa Node CI + on: - workflow_dispatch + pull_request: + branches: + - master + jobs: build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # cancel concurrent builds on the same branch - concurrency: - group: ${{ github.head_ref || github.run_id }} - cancel-in-progress: true + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Get submodules run: git submodule update --init --recursive @@ -27,6 +25,11 @@ jobs: target: wasm32-unknown-unknown default: true + - name: Install protoc + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler + - name: Cache restore uses: actions/cache@v3 with: @@ -50,3 +53,15 @@ jobs: - name: Build run: cargo build --locked --release + + - name: Upload Artifacts Alphanet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-alphanet + path: target/release/wbuild/alphanet-runtime/alphanet_runtime.compact.compressed.wasm + + - name: Upload Artifacts Mainnet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-mainnet + path: target/release/wbuild/mainnet-runtime/mainnet_runtime.compact.compressed.wasm From 4f6f87bcaa8f4101f10137ace4dfc5391962d5f8 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 11:16:48 +1200 Subject: [PATCH 20/24] Dedicated workflow when making a PR to main branch --- .github/scripts/read-scw-machines.py | 4 ---- .github/workflows/ci.yml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/scripts/read-scw-machines.py b/.github/scripts/read-scw-machines.py index 939ae130..fd298c03 100644 --- a/.github/scripts/read-scw-machines.py +++ b/.github/scripts/read-scw-machines.py @@ -26,10 +26,6 @@ def is_ok(config, runner): config = sys.argv[1] data = json.load(sys.stdin) -print('--------------------') -print('config: ' + config) -print( data) -print('--------------------') to_turn_off = [] for runner in data["runners"]: if (not is_ok(config, runner)): diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0a106dc..13d18bd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Ternoa Node CI on: pull_request: branches: - - master + - main jobs: build: From 3ea44a3bb39a2d99e1f153df4918ca73a00bb255 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 11:30:54 +1200 Subject: [PATCH 21/24] Added tests --- .github/workflows/build-debian-11-binary.yml | 94 +------ .../workflows/build-ubuntu-2204-binary.yml | 259 ++---------------- .github/workflows/build-wasm.yml | 2 +- .github/workflows/ci.yml | 4 +- .github/workflows/run-tests.yml | 2 +- 5 files changed, 29 insertions(+), 332 deletions(-) diff --git a/.github/workflows/build-debian-11-binary.yml b/.github/workflows/build-debian-11-binary.yml index bdd9457c..9795ded2 100644 --- a/.github/workflows/build-debian-11-binary.yml +++ b/.github/workflows/build-debian-11-binary.yml @@ -30,96 +30,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: assets-for-download - path: output - - -# name: Build Debian 11 Binary -# on: -# workflow_dispatch - -# jobs: -# build: -# # no support for debian-11 yet -# runs-on: ubuntu-22.04 -# # runs-on: debian-11 - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 - -# - name: Get submodules -# run: git submodule update --init --recursive - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# profile: minimal -# toolchain: nightly-2022-04-24 -# components: rustfmt, llvm-tools-preview -# target: wasm32-unknown-unknown -# default: true - -# - name: Install protoc -# run: | -# sudo apt update -# sudo apt install -y protobuf-compiler - -# - name: Cache restore -# uses: actions/cache@v3 -# with: -# path: | -# ~/.cargo/bin/ -# ~/.cargo/registry/index/ -# ~/.cargo/registry/cache/ -# ~/.cargo/git/db/ -# target/ -# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - -# - name: Clean -# if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} -# run: cargo clean - -# - name: Check format -# run: cargo fmt --all -- --check - -# - name: Check release -# run: cargo check --release - -# - name: Build -# run: cargo build --locked --release - -# name: Build Debian 11 Binary - -# on: -# workflow_dispatch: - -# env: -# CARGO_TERM_COLOR: always - -# jobs: -# call-start-new-build-machine: -# uses: ./.github/workflows/start-new-build-machine.yml -# secrets: inherit - -# build: -# runs-on: ubuntu-latest -# name: Build Debian 11 Binary -# steps: -# - uses: actions/checkout@v3 - -# - name: "Build DockerImage" -# run: podman build -t tchain -f ./dockerimages/debian-11.Dockerfile . - -# - name: "Create output folder." -# run: mkdir output - -# - name: "Run Build Binary Script" -# run: podman run --rm -v ./output:/output -t tchain - -# - name: Upload Artifacts -# uses: actions/upload-artifact@v3 -# with: -# name: assets-for-download -# path: output - - \ No newline at end of file + path: output \ No newline at end of file diff --git a/.github/workflows/build-ubuntu-2204-binary.yml b/.github/workflows/build-ubuntu-2204-binary.yml index f45685f3..f38421bf 100644 --- a/.github/workflows/build-ubuntu-2204-binary.yml +++ b/.github/workflows/build-ubuntu-2204-binary.yml @@ -1,246 +1,33 @@ name: Build Ubuntu 22.04 Binary + on: - workflow_dispatch + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always jobs: - build: - runs-on: ubuntu-22.04 + call-start-new-build-machine: + uses: ./.github/workflows/start-new-build-machine.yml + secrets: inherit + build: + runs-on: GP1-M + name: Build Ubuntu 2204 Binary steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Get submodules - run: git submodule update --init --recursive - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2022-04-24 - components: rustfmt, llvm-tools-preview - target: wasm32-unknown-unknown - default: true - - - name: Install protoc - run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler - - - name: Cache restore - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Clean - if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} - run: cargo clean - - - name: Check format - run: cargo fmt --all -- --check - - - name: Check release - run: cargo check --release - - - name: Build - run: cargo build --locked --release - - - name: Upload Artifacts Alphanet - uses: actions/upload-artifact@v3 - with: - name: assets-for-download-alphanet - path: target/release/wbuild/alphanet-runtime/alphanet_runtime.compact.compressed.wasm - - - name: Upload Artifacts Mainnet - uses: actions/upload-artifact@v3 - with: - name: assets-for-download-mainnet - path: target/release/wbuild/mainnet-runtime/mainnet_runtime.compact.compressed.wasm -# name: Build Ubuntu 22.04 Binary -# on: -# workflow_dispatch -# jobs: -# build: -# # The type of runner that the job will run on -# runs-on: ubuntu-latest - -# # cancel concurrent builds on the same branch -# concurrency: -# group: ${{ github.head_ref || github.run_id }} -# cancel-in-progress: true - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 - -# - name: Get submodules -# run: git submodule update --init --recursive - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# profile: minimal -# toolchain: nightly-2022-04-24 -# components: rustfmt, llvm-tools-preview -# target: wasm32-unknown-unknown -# default: true - -# - name: Install protoc -# run: | -# sudo apt-get update -# sudo apt-get install -y protobuf-compiler - -# - name: Cache restore -# uses: actions/cache@v3 -# with: -# path: | -# ~/.cargo/bin/ -# ~/.cargo/registry/index/ -# ~/.cargo/registry/cache/ -# ~/.cargo/git/db/ -# target/ -# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - -# - name: Clean -# if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} -# run: cargo clean - -# - name: Check format -# run: cargo fmt --all -- --check - -# - name: Check release -# run: cargo check --release - -# - name: Build -# run: cargo build --locked --release - - -# name: Build Ubuntu 22.04 Binary - -# on: -# workflow_dispatch: - -# env: -# CARGO_TERM_COLOR: always - -# jobs: - -# build: -# runs-on: ubuntu-latest -# name: Build Ubuntu 2204 Binary -# steps: -# - uses: actions/checkout@v3 - -# - name: "Build DockerImage" -# run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . - -# - name: "Create output folder." -# run: mkdir output - -# - name: "Run Build Binary Script" -# run: podman run --rm -v ./output:/output -t tchain - -# - name: Upload Artifacts -# uses: actions/upload-artifact@v3 -# with: -# name: assets-for-download -# path: output - - -# # name: Build Ubuntu 22.04 Binary - -# # on: -# # workflow_dispatch: -# # inputs: -# # ubuntu_version: -# # description: 'Ubuntu Version' -# # required: true -# # default: '22.04' - -# # env: -# # CARGO_TERM_COLOR: always - -# # jobs: -# # call-start-new-build-machine: -# # uses: ./.github/workflows/start-new-build-machine.yml -# # secrets: inherit - -# # build: -# # runs-on: ubuntu-latest -# # name: Build Ubuntu 2204 Binary -# # steps: -# # - uses: actions/checkout@v3 - -# # - name: "Build DockerImage" -# # run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . - -# # - name: "Create output folder." -# # # run: mkdir output -# # # - name: Create Output Folder -# # run: | -# # mkdir output -# # sudo chown $USER output - -# # - name: "Run Build Binary Script" -# # run: podman run --rm -v ./output:/output -t tchain - -# # - name: Upload Artifacts -# # uses: actions/upload-artifact@v3 -# # with: -# # name: assets-for-download -# # path: output - -# # name: Build Ubuntu 22.04 Binary - -# # on: -# # workflow_dispatch: -# # inputs: -# # ubuntu_version: -# # description: 'Ubuntu Version' -# # required: true -# # default: '22.04' - -# # jobs: -# # build: -# # runs-on: ubuntu-latest -# # name: Build Ubuntu 22.04 Binary -# # steps: -# # - name: Checkout Repository -# # uses: actions/checkout@v3 - -# # - name: Set up Podman -# # run: | -# # sudo apt-get update -# # sudo apt-get install -y podman + - uses: actions/checkout@v3 -# # - name: Build Podman Image -# # run: | -# # podman build \ -# # --platform linux/amd64 \ -# # --tag tchain \ -# # -f ./dockerimages/ubuntu-2204.Dockerfile \ -# # --log-level debug \ -# # --events-backend file + - name: "Build DockerImage" + run: podman build -t tchain -f ./dockerimages/ubuntu-2204.Dockerfile . -# # - name: Create Output Folder -# # run: | -# # mkdir output -# # sudo chown $USER output + - name: "Create output folder." + run: mkdir output -# # - name: Run Build Binary Script -# # run: | -# # podman run --rm \ -# # -v ${{ github.workspace }}/output:/output \ -# # -t tchain + - name: "Run Build Binary Script" + run: podman run --rm -v ./output:/output -t tchain -# # - name: Upload Artifacts -# # uses: actions/upload-artifact@v2 -# # with: -# # name: assets-for-download -# # path: output + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: assets-for-download + path: output diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 88d49b9f..d7fbb5f5 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -21,7 +21,7 @@ jobs: secrets: inherit build: - runs-on: ubuntu-latest + runs-on: GP1-M name: Build WASM steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13d18bd7..aa41cebf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,6 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Clean - if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }} run: cargo clean - name: Check format @@ -51,6 +50,9 @@ jobs: - name: Check release run: cargo check --release + - name: Tests + run: cargo test --all + - name: Build run: cargo build --locked --release diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 23600540..3ee4d7ad 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: secrets: inherit build: - runs-on: ubuntu-latest + runs-on: GP1-M name: Run Tests steps: - uses: actions/checkout@v3 From 8aab1350974634d319b69c21d60e999a75a61ef8 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 22:22:15 +1200 Subject: [PATCH 22/24] Added ondemand --- .github/workflows/ci.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa41cebf..404e0848 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,18 +52,3 @@ jobs: - name: Tests run: cargo test --all - - - name: Build - run: cargo build --locked --release - - - name: Upload Artifacts Alphanet - uses: actions/upload-artifact@v3 - with: - name: assets-for-download-alphanet - path: target/release/wbuild/alphanet-runtime/alphanet_runtime.compact.compressed.wasm - - - name: Upload Artifacts Mainnet - uses: actions/upload-artifact@v3 - with: - name: assets-for-download-mainnet - path: target/release/wbuild/mainnet-runtime/mainnet_runtime.compact.compressed.wasm From ebdff406d6b9d1b210f4c551b41dfb4f3e0bcfe0 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 22:22:40 +1200 Subject: [PATCH 23/24] Added ondemand --- .github/workflows/ci-ondemand.yml | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/ci-ondemand.yml diff --git a/.github/workflows/ci-ondemand.yml b/.github/workflows/ci-ondemand.yml new file mode 100644 index 00000000..0bd50a5e --- /dev/null +++ b/.github/workflows/ci-ondemand.yml @@ -0,0 +1,79 @@ +name: Ternoa Node CI + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get submodules + run: git submodule update --init --recursive + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-24 + components: rustfmt, llvm-tools-preview + target: wasm32-unknown-unknown + default: true + + - name: Install protoc + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler + + - name: Cache restore + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Clean + run: cargo clean + + - name: Check format + run: cargo fmt --all -- --check + + - name: Check release + run: cargo check --release + + - name: Tests + run: cargo test --all + + - name: Build + run: cargo build --locked --release + + - name: Upload WASM Alphanet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-alphanet + path: target/release/wbuild/alphanet-runtime/alphanet_runtime.compact.compressed.wasm + + - name: Upload WASM Mainnet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-mainnet + path: target/release/wbuild/mainnet-runtime/mainnet_runtime.compact.compressed.wasm + + - name: Upload Binary Alphanet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-alphanet + path: target/release/wbuild/alphanet-runtime/alphanet_runtime.compact.compressed.wasm + + - name: Upload Binary Mainnet + uses: actions/upload-artifact@v3 + with: + name: assets-for-download-mainnet + path: target/release/wbuild/mainnet-runtime/mainnet_runtime.compact.compressed.wasm From ef6cc029bcc568bb839148b197b3b752b25b8f58 Mon Sep 17 00:00:00 2001 From: tapiocaboy Date: Thu, 18 May 2023 22:29:48 +1200 Subject: [PATCH 24/24] Added ondemand --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 404e0848..014a4edf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,8 +47,5 @@ jobs: - name: Check format run: cargo fmt --all -- --check - - name: Check release - run: cargo check --release - - name: Tests run: cargo test --all