Skip to content

Commit

Permalink
check cc on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Dec 10, 2023
1 parent 80b743b commit a59fc92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 13 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
arch:
description: 'Target architecture'
required: true
cross:
description: 'Whether to install cross'
required: false
default: ${{ arch != 'x86_64' }}
coverage:
description: 'Whether to install cargo-tarpaulin'
required: false
Expand Down Expand Up @@ -37,11 +41,11 @@ runs:
esac
echo "CARGO_BUILD_TARGET=$target" >> $GITHUB_ENV
- name: Install Target
if: inputs.arch == 'aarch64'
if: fromJson(inputs.cross)
shell: bash
run: rustup target add $CARGO_BUILD_TARGET
- name: Cross Compile Dependencies (Linux x86_64 to Linux aarch64)
if: inputs.arch == 'aarch64' && startsWith(inputs.os, 'ubuntu')
- name: Setup Cross Compiling Toolchain (Linux x86_64 to aarch64)
if: fromJson(inputs.cross) && inputs.arch == 'aarch64' && startsWith(inputs.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
Expand All @@ -52,6 +56,12 @@ runs:
echo "AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar" >> $GITHUB_ENV
echo "CFLAGS_aarch64_unknown_linux_gnu=--sysroot=/usr/aarch64-linux-gnu" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Setup Cross Compiling Toolchain (macOS x86_64 to aarch64)
if: fromJson(inputs.cross) && inputs.arch == 'aarch64' && startsWith(inputs.os, 'macos')
shell: bash
run: |
which cc
cc --version
- name: Install Cargo tarpaulin
if: fromJson(inputs.coverage)
uses: taiki-e/install-action@v2
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,10 @@ jobs:
arch: aarch64
- name: Setup Cache
uses: Swatinem/rust-cache@v2
- name: Build (Linux)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: Build
run: |
cargo build --package maa-cli --locked \
--features git2/vendored-openssl,reqwest/native-tls-vendored
- name: Build (macOS)
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
cargo build --package maa-cli --locked \
--features git2/vendored-openssl
features:
name: Build and Test (no default features)
Expand Down

0 comments on commit a59fc92

Please sign in to comment.