Skip to content

Commit

Permalink
[CI] Clang 17 (from Dart SDK) CI coverage (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes authored Sep 15, 2023
1 parent 88d185c commit 3c81311
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/native_toolchain_c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: dart
permissions: read-all

on:
pull_request:
branches: [main]
paths:
- ".github/workflows/native_toolchain_c.yaml"
- "pkgs/native_toolchain_c/**"
push:
branches: [main]
paths:
- ".github/workflows/native_toolchain_c.yaml"
- "pkgs/native_toolchain_c/**"
schedule:
- cron: "0 0 * * 0" # weekly

jobs:
dart-sdk-clang:
strategy:
matrix:
os: [ubuntu]
sdk: [stable]
package: [native_toolchain_c]

runs-on: ${{ matrix.os }}-latest

defaults:
run:
working-directory: pkgs/${{ matrix.package }}

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744

- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: ${{ matrix.sdk }}

- uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3
with:
ndk-version: r25b
if: ${{ matrix.sdk == 'stable' }}

- run: dart pub get

- name: Install native toolchains
run: sudo apt-get update && sudo apt-get install gcc-i686-linux-gnu gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
if: ${{ matrix.sdk == 'stable' && matrix.os == 'ubuntu' }}

- run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- run: echo "$PWD/depot_tools" >> $GITHUB_PATH
- run: mkdir dart-sdk
- run: cd dart-sdk && fetch --no-history dart
- run: echo "./dart-sdk/sdk/buildtools/linux-x64/clang/bin" >> $GITHUB_PATH
- run: clang --version

- run: dart test
if: ${{ matrix.sdk == 'stable' }}
4 changes: 4 additions & 0 deletions pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ class PathToolResolver extends ToolResolver {
if (process.exitCode == 0) {
final file = File(LineSplitter.split(process.stdout).first);
final uri = File(await file.resolveSymbolicLinks()).uri;
if (uri.pathSegments.last == 'llvm') {
// https://github.com/dart-lang/native/issues/136
return file.uri;
}
return uri;
}
// The exit code for executable not being on the `PATH`.
Expand Down

0 comments on commit 3c81311

Please sign in to comment.