From 942c872ccd9f3b2efcffea4e6f48bae12a2cd9b4 Mon Sep 17 00:00:00 2001 From: danbugs Date: Tue, 26 Dec 2023 12:32:09 -0800 Subject: [PATCH] fixing CI Signed-off-by: danbugs --- .github/workflows/ci-cd.yml | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index dbafb33..aaa03f9 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -37,6 +37,7 @@ jobs: - name: Clippy check run: cargo clippy -p smithe_backend -p smithe_database -p smithe_lib -p startgg -- -D warnings + build: needs: lint-and-format strategy: @@ -66,23 +67,44 @@ jobs: override: true target: ${{ matrix.target }} - - if: matrix.os == 'windows-latest' - name: Install PostgreSQL - uses: ikalnytskyi/action-setup-postgres@v4 + - if: matrix.os == 'ubuntu-20.04' + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - if: matrix.os == 'windows-latest' + - if: matrix.os == 'ubuntu-20.04' + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: danstaken + password: ${{ secrets.DOCKER_PASSWORD }} + + - if: matrix.os == 'ubuntu-20.04' + name: Build and push multi-architecture Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile-BuildArm64 + push: true + tags: danstaken/rust-build-env-arm64:latest + platforms: linux/arm64 + + - if: matrix.os == 'ubuntu-20.04' name: Install cross run: cargo install cross # Conditional step for standard Rust build for non-arm64 targets - - if: matrix.os == 'windows-latest' + - if: matrix.os == 'ubuntu-20.04' name: Cross build for arm64 run: cross build --release --target aarch64-unknown-linux-gnu env: SERVER_ADDRESS: 'http://127.0.0.1:8080' + - if: matrix.os == 'windows-latest' + name: Install PostgreSQL + uses: ikalnytskyi/action-setup-postgres@v4 + - name: Build - run: cargo build --release --target ${{ matrix.target }} + run: build --release --target ${{ matrix.target }} env: SERVER_ADDRESS: 'http://127.0.0.1:8080'