pure-zstd/.github/workflows/ci.yml
2026-09-22 19:46:34 -06:00

64 lines
1.8 KiB
YAML

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
check:
name: Format, analyze, and validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dart-lang/setup-dart@v1
- uses: actions/cache@v6
with:
path: ~/.pub-cache
key: pub-${{ runner.os }}-stable-${{ hashFiles('pubspec.yaml') }}
- run: dart pub get
- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze --fatal-infos
- run: dart run example/pure_zstd_example.dart
- run: dart pub publish --dry-run
test:
name: Test (Dart ${{ matrix.sdk }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# The floor declared in pubspec.yaml, and the current release.
sdk: [3.8.0, stable]
include:
- os: ubuntu-latest
sdk: beta
steps:
- uses: actions/checkout@v7
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/cache@v6
with:
path: |
~/.pub-cache
~/AppData/Local/Pub/Cache
key: pub-${{ runner.os }}-${{ matrix.sdk }}-${{ hashFiles('pubspec.yaml') }}
# libzstd_shapes_test.dart compresses its inputs with the zstd CLI and
# skips itself when there is none. Only Windows lacks it out of the box.
- if: runner.os == 'macOS'
run: command -v zstd || brew install zstd
- run: dart pub get
- run: dart test
pana:
name: pub.dev score
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dart-lang/setup-dart@v1
- run: dart pub global activate pana
- run: dart pub global run pana --no-warning --exit-code-threshold 0 .