From 09b7d9837dcd8dd59783535a48c284def527f6f7 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Fri, 20 Oct 2023 09:30:52 -0700 Subject: [PATCH 1/2] Add riscv build and test workflow --- .github/workflows/build-riscv.yml | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/build-riscv.yml diff --git a/.github/workflows/build-riscv.yml b/.github/workflows/build-riscv.yml new file mode 100644 index 000000000..d7b0d32fe --- /dev/null +++ b/.github/workflows/build-riscv.yml @@ -0,0 +1,81 @@ +name: QEMU Build and test riscv64 crate + +on: + push: + branches: + - main + - dev + tags: + - '**' + pull_request: + branches: + - '**' + +jobs: + build_crate: + name: Build riscv64 crate and run tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Set up QEMU on x86_64 + id: qemu + uses: docker/setup-qemu-action@v2 + with: + platforms: riscv64 + + - name: Build and Test + run: | + docker run --rm --platform linux/riscv64 \ + -v ${{ github.workspace }}:/ws --workdir=/ws \ + chianetwork/ubuntu-22.04-risc-builder:latest \ + bash -exc '\ + cargo test --release + ' + + build_wheels: + name: QEMU riscv64 wheel + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Set up QEMU on x86_64 + id: qemu + uses: docker/setup-qemu-action@v2 + with: + platforms: riscv64 + + - name: Build + run: | + docker run --rm --platform linux/riscv64 \ + -v ${{ github.workspace }}:/ws --workdir=/ws \ + chianetwork/ubuntu-22.04-risc-builder:latest \ + bash -exc '\ + pyenv global 3.10 + python -m venv venv && \ + source ./venv/bin/activate && \ + pip install --upgrade pip && \ + pip install --extra-index-url https://pypi.chia.net/simple/ maturin==1.2.3 && \ + maturin build -i python --release --strip \ + ' + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: packages + path: ./wheel/target/wheels/ + From 2ee4a3b347a49380d589c0fd1651ba189bd0284f Mon Sep 17 00:00:00 2001 From: Earle Lowe <30607889+emlowe@users.noreply.github.com> Date: Mon, 23 Oct 2023 07:30:23 -0700 Subject: [PATCH 2/2] fix upload path --- .github/workflows/build-riscv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-riscv.yml b/.github/workflows/build-riscv.yml index d7b0d32fe..7fef28d9d 100644 --- a/.github/workflows/build-riscv.yml +++ b/.github/workflows/build-riscv.yml @@ -77,5 +77,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: packages - path: ./wheel/target/wheels/ + path: ./target/wheels/