-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
action: test build with more architectures
Test build with more architectures, but only use `amd64` in next jobs. Signed-off-by: Yadong Ding <[email protected]>
- Loading branch information
1 parent
a3e60c0
commit 40f068e
Showing
1 changed file
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ env: | |
jobs: | ||
contrib-build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [amd64, arm64, ppc64le, riscv64] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -31,36 +34,48 @@ jobs: | |
- name: Build Contrib | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2 | ||
make -e DOCKER=false nydusify-release | ||
make -e DOCKER=false contrib-test | ||
make -e DOCKER=false GOARCH=${{ matrix.arch }} nydusify-release | ||
if [[ "${{matrix.arch}}" == "amd64" ]]; then | ||
make -e DOCKER=false GOARCH=${{ matrix.arch }} contrib-test | ||
fi | ||
- name: Upload Nydusify | ||
if: matrix.arch == 'amd64' | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: nydusify-artifact | ||
path: contrib/nydusify/cmd | ||
|
||
nydus-build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [amd64, arm64, ppc64le, riscv64] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
with: | ||
cache-on-failure: true | ||
shared-key: Linux-cargo-amd64 | ||
shared-key: ${{ runner.os }}-cargo-${{ matrix.arch }} | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
- name: Build Nydus | ||
run: | | ||
declare -A rust_target_map=( ["amd64"]="x86_64-unknown-linux-musl" ["arm64"]="aarch64-unknown-linux-musl" ["ppc64le"]="powerpc64le-unknown-linux-gnu" ["riscv64"]="riscv64gc-unknown-linux-gnu") | ||
RUST_TARGET=${rust_target_map[${{ matrix.arch }}]} | ||
cargo install --version 0.2.4 cross | ||
rustup component add rustfmt clippy | ||
make | ||
make -e RUST_TARGET_STATIC=$RUST_TARGET -e CARGO=cross static-release | ||
sudo mv target/$RUST_TARGET/release/nydusd . | ||
sudo mv target/$RUST_TARGET/release/nydus-image . | ||
- name: Upload Nydus Binaries | ||
if: matrix.arch == 'amd64' | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: nydus-artifact | ||
path: | | ||
target/release/nydus-image | ||
target/release/nydusd | ||
nydus-image | ||
nydusd | ||
nydusd-build-macos: | ||
runs-on: macos-11 | ||
|