Skip to content

fix: fetch modules when submodules is not initialized #5

fix: fetch modules when submodules is not initialized

fix: fetch modules when submodules is not initialized #5

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
# ── Analyze ──────────────────────────────────────────────────────────────────
analyze:
name: Analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: dart pub get
- name: Analyze
run: dart analyze --fatal-infos
# ── Test: Mode 1 — submodule (pub.dev path) ──────────────────────────────────
test-submodule:
name: Test / submodule (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install system deps
run: |
sudo apt-get update -q
sudo apt-get install -y cmake ninja-build clang
- name: Install Dart/Flutter dependencies
run: dart pub get
- name: Build native library (Mode 1 — submodule)
run: |
cmake -S bclibc -B build/bclibc -DCMAKE_BUILD_TYPE=Debug -G Ninja
cmake --build build/bclibc --parallel
- name: Run tests
run: dart test
# ── Test: Mode 3 — FetchContent (git dep path) ───────────────────────────────
test-fetchcontent:
name: Test / FetchContent (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# no submodules — simulates `dart pub get` of a git dep
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install system deps
run: |
sudo apt-get update -q
sudo apt-get install -y cmake ninja-build clang
- name: Install Dart/Flutter dependencies
run: dart pub get
- name: Build native library (Mode 3 — FetchContent)
run: |
cmake -S linux -B build/linux \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$PWD/build/linux/lib \
-G Ninja
cmake --build build/linux --parallel
- name: Run tests
env:
BCLIBC_FFI_PATH: build/linux/lib/libbclibc_ffi.so
run: dart test
# ── Test: macOS ───────────────────────────────────────────────────────────────
test-macos:
name: Test / submodule (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install Dart/Flutter dependencies
run: dart pub get
- name: Build native library (Mode 1 — submodule)
run: |
cmake -S bclibc -B build/bclibc -DCMAKE_BUILD_TYPE=Debug
cmake --build build/bclibc --parallel
- name: Run tests
run: dart test
# ── pub.dev publish dry-run ───────────────────────────────────────────────────
publish-dry-run:
name: pub.dev dry-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: dart pub get
- name: Publish dry-run
run: dart pub publish --dry-run