Skip to content

Commit

Permalink
fixing cache for cross CI build
Browse files Browse the repository at this point in the history
Signed-off-by: danbugs <[email protected]>
  • Loading branch information
danbugs committed Dec 26, 2023
1 parent 6afac55 commit d226c5e
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,38 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- if: matrix.os == 'windows-latest'
name: Install PostgreSQL
uses: ikalnytskyi/action-setup-postgres@v4

- if: matrix.os == 'ubuntu-20.04'
name: Install QEMU user emulation
run: docker run --rm --privileged tonistiigi/binfmt --install all

- if: matrix.os == 'ubuntu-20.04'
name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target }}

- if: matrix.os == 'ubuntu-20.04'
name: Install QEMU user emulation
run: |
docker run --rm --privileged tonistiigi/binfmt --install all
target: ${{ matrix.target }}

- if: matrix.os == 'ubuntu-20.04'
name: Install cross
run: cargo install cross
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

# Conditional step for standard Rust build for non-arm64 targets
- if: matrix.os == 'ubuntu-20.04'
name: Cross build for arm64
run: cross build --release --target aarch64-unknown-linux-gnu
run: |
cross build --release --target aarch64-unknown-linux-gnu
ls -la target/aarch64-unknown-linux-gnu/release/
env:
SERVER_ADDRESS: 'http://127.0.0.1:8080'
CROSS_CONTAINER_OPTS: '--platform linux/arm64'

- if: matrix.os == 'windows-latest'
name: Install PostgreSQL
uses: ikalnytskyi/action-setup-postgres@v4
CROSS_CONTAINER_OPTS: '--platform linux/arm64'

- name: Build
run: cargo build --release --target ${{ matrix.target }}
Expand Down

0 comments on commit d226c5e

Please sign in to comment.