|
| 1 | +name: QEMU Build and test riscv64 crate |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - dev |
| 8 | + tags: |
| 9 | + - '**' |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - '**' |
| 13 | + |
| 14 | +jobs: |
| 15 | + build_crate: |
| 16 | + name: Build riscv64 crate and run tests |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + os: [ ubuntu-latest ] |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v3 |
| 25 | + with: |
| 26 | + fetch-depth: 1 |
| 27 | + |
| 28 | + - name: Set up QEMU on x86_64 |
| 29 | + id: qemu |
| 30 | + uses: docker/setup-qemu-action@v2 |
| 31 | + with: |
| 32 | + platforms: riscv64 |
| 33 | + |
| 34 | + - name: Build and Test |
| 35 | + run: | |
| 36 | + docker run --rm --platform linux/riscv64 \ |
| 37 | + -v ${{ github.workspace }}:/ws --workdir=/ws \ |
| 38 | + chianetwork/ubuntu-22.04-risc-builder:latest \ |
| 39 | + bash -exc '\ |
| 40 | + cargo test --release |
| 41 | + ' |
| 42 | +
|
| 43 | + build_wheels: |
| 44 | + name: QEMU riscv64 wheel |
| 45 | + runs-on: ${{ matrix.os }} |
| 46 | + strategy: |
| 47 | + matrix: |
| 48 | + os: [ ubuntu-latest ] |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout repository |
| 52 | + uses: actions/checkout@v3 |
| 53 | + with: |
| 54 | + fetch-depth: 1 |
| 55 | + |
| 56 | + - name: Set up QEMU on x86_64 |
| 57 | + id: qemu |
| 58 | + uses: docker/setup-qemu-action@v2 |
| 59 | + with: |
| 60 | + platforms: riscv64 |
| 61 | + |
| 62 | + - name: Build |
| 63 | + run: | |
| 64 | + docker run --rm --platform linux/riscv64 \ |
| 65 | + -v ${{ github.workspace }}:/ws --workdir=/ws \ |
| 66 | + chianetwork/ubuntu-22.04-risc-builder:latest \ |
| 67 | + bash -exc '\ |
| 68 | + pyenv global 3.10 |
| 69 | + python -m venv venv && \ |
| 70 | + source ./venv/bin/activate && \ |
| 71 | + pip install --upgrade pip && \ |
| 72 | + pip install --extra-index-url https://pypi.chia.net/simple/ maturin==1.2.3 && \ |
| 73 | + maturin build -i python --release --strip \ |
| 74 | + ' |
| 75 | +
|
| 76 | + - name: Upload artifacts |
| 77 | + uses: actions/upload-artifact@v3 |
| 78 | + with: |
| 79 | + name: packages |
| 80 | + path: ./wheel/target/wheels/ |
| 81 | + |
0 commit comments