Skip to content

Commit 6228ebc

Browse files
committed
try cross tool
cleanup workflow a bit rename test job at runtime bump codecov action
1 parent adecf1f commit 6228ebc

File tree

2 files changed

+21
-34
lines changed

2 files changed

+21
-34
lines changed

.github/workflows/binary-builds.yml

+13-27
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,8 @@ jobs:
3434
include:
3535
- target: aarch64-unknown-linux-gnu
3636
os: ubuntu-latest
37-
## I GIVE UP! For this target, OpenSSL needs to be cross compiled
38-
## which is driven by openssl-sys crate's custom build script...
39-
## Linux users with aarch64 (aka ARM64) using musl C lib can go fish (or build from source).
40-
# - target: aarch64-unknown-linux-musl
41-
# os: ubuntu-latest
37+
- target: aarch64-unknown-linux-musl
38+
os: ubuntu-latest
4239
- target: x86_64-unknown-linux-gnu
4340
os: ubuntu-latest
4441
- target: x86_64-unknown-linux-musl
@@ -56,17 +53,6 @@ jobs:
5653
- name: Install native OpenSSL on Linux
5754
if: runner.os == 'Linux' && !(startsWith(matrix.target, 'aarch64') || endsWith(matrix.target, 'musl'))
5855
run: sudo apt-get install -y pkg-config libssl-dev
59-
- name: Install GCC for aarch64 (for cross-compiling openssl)
60-
if: runner.os == 'Linux' && startsWith(matrix.target, 'aarch64')
61-
run: |
62-
sudo apt-get update
63-
sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
64-
if [[ "${{matrix.target}}" == *musl ]]; then
65-
sudo apt-get install musl-dev musl-tools
66-
fi
67-
- name: Install musl-gcc (for compiling OpenSSL)
68-
if: matrix.target == 'x86_64-unknown-linux-musl'
69-
run: sudo apt-get install musl-tools
7056

7157
- name: Calculate openssl-vendored
7258
shell: bash
@@ -98,20 +84,20 @@ jobs:
9884
with:
9985
target: ${{ matrix.target }}
10086

101-
# problems with cross-compiling linux with musl
102-
- run: echo "RUSTFLAGS=-D warnings -C target-feature=+crt-static -C link-self-contained=yes" >> "${GITHUB_ENV}"
103-
if: contains(matrix.target, '-linux-musl')
104-
- run: |
105-
echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
106-
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
107-
if: matrix.target == 'aarch64-unknown-linux-musl'
87+
- name: Install cross (cargo cross compiler)
88+
if: matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64'))
89+
uses: taiki-e/install-action@v2
90+
with:
91+
tool: cross
10892

109-
- name: Build
110-
env:
111-
# problems with cross-compiling aarch64 linux with gnu
112-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
93+
- name: Build (native)
94+
if: ${{!(matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64')))}}
11395
run: cargo build --manifest-path cpp-linter-lib/Cargo.toml --release --bin cpp-linter --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
11496

97+
- name: Build (cross)
98+
if: matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64'))
99+
run: cross build --manifest-path cpp-linter-lib/Cargo.toml --release --bin cpp-linter --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
100+
115101
- name: Prepare artifacts
116102
run: mv target/${{ matrix.target }}/release/cpp-linter${{ runner.os == 'Windows' && '.exe' || '' }} ./cpp-linter-${{ matrix.target }}${{ runner.os == 'Windows' && '.exe' || '' }}
117103
- name: Upload artifacts

.github/workflows/run-dev-tests.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020

2121
jobs:
2222
test:
23+
name: test ${{ matrix.os }} w/ clang v${{ matrix.version }}
2324
strategy:
2425
fail-fast: false
2526
matrix:
@@ -33,12 +34,12 @@ jobs:
3334
- run: rustup component add llvm-tools-preview
3435

3536
# https://docs.rs/openssl/latest/openssl/#automatic
36-
- name: Install OpenSSL (Linux)
37-
if: runner.os == 'Linux'
38-
run: sudo apt-get install -y pkg-config libssl-dev
39-
- name: Install OpenSSL (MacOS)
40-
if: runner.os == 'macOS'
41-
run: brew install openssl@3
37+
# - name: Install OpenSSL (Linux)
38+
# if: runner.os == 'Linux'
39+
# run: sudo apt-get install -y pkg-config libssl-dev
40+
# - name: Install OpenSSL (MacOS)
41+
# if: runner.os == 'macOS'
42+
# run: brew install openssl@3
4243
# - name: Install OpenSSL (Windows)
4344
# if: runner.os == 'Windows'
4445
# run: vcpkg install openssl
@@ -114,7 +115,7 @@ jobs:
114115
run: |
115116
cargo llvm-cov report --lcov --output-path lcov.info
116117
117-
- uses: codecov/codecov-action@v3
118+
- uses: codecov/codecov-action@v4
118119
if: matrix.version == '16' && runner.os == 'Linux'
119120
with:
120121
token: ${{secrets.CODECOV_TOKEN}}

0 commit comments

Comments
 (0)