| 
 | 1 | +name: package:crypto  | 
 | 2 | + | 
 | 3 | +on:  | 
 | 4 | +  # Run CI on pushes to the main branch, and on PRs against main.  | 
 | 5 | +  push:  | 
 | 6 | +    branches: [ main ]  | 
 | 7 | +    paths:  | 
 | 8 | +      - '.github/workflows/crypto.yaml'  | 
 | 9 | +      - 'pkgs/crypto/**'  | 
 | 10 | +  pull_request:  | 
 | 11 | +    branches: [ main ]  | 
 | 12 | +    paths:  | 
 | 13 | +      - '.github/workflows/crypto.yaml'  | 
 | 14 | +      - 'pkgs/crypto/**'  | 
 | 15 | +  schedule:  | 
 | 16 | +    - cron: "0 0 * * 0"  | 
 | 17 | +env:  | 
 | 18 | +  PUB_ENVIRONMENT: bot.github  | 
 | 19 | + | 
 | 20 | +defaults:  | 
 | 21 | +  run:  | 
 | 22 | +    working-directory: pkgs/crypto/  | 
 | 23 | + | 
 | 24 | +jobs:  | 
 | 25 | +  # Check code formatting and static analysis on a single OS (linux)  | 
 | 26 | +  # against Dart dev.  | 
 | 27 | +  analyze:  | 
 | 28 | +    runs-on: ubuntu-latest  | 
 | 29 | +    strategy:  | 
 | 30 | +      fail-fast: false  | 
 | 31 | +      matrix:  | 
 | 32 | +        sdk: [dev]  | 
 | 33 | +    steps:  | 
 | 34 | +      - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938  | 
 | 35 | +      - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672  | 
 | 36 | +        with:  | 
 | 37 | +          sdk: ${{ matrix.sdk }}  | 
 | 38 | +      - id: install  | 
 | 39 | +        name: Install dependencies  | 
 | 40 | +        run: dart pub get  | 
 | 41 | +      - name: Check formatting  | 
 | 42 | +        run: dart format --output=none --set-exit-if-changed .  | 
 | 43 | +        if: always() && steps.install.outcome == 'success'  | 
 | 44 | +      - name: Analyze code  | 
 | 45 | +        run: dart analyze --fatal-infos  | 
 | 46 | +        if: always() && steps.install.outcome == 'success'  | 
 | 47 | + | 
 | 48 | +  # Run tests on a matrix consisting of two dimensions:  | 
 | 49 | +  # 1. OS: ubuntu-latest, (macos-latest, windows-latest)  | 
 | 50 | +  # 2. release channel: dev  | 
 | 51 | +  test:  | 
 | 52 | +    needs: analyze  | 
 | 53 | +    runs-on: ${{ matrix.os }}  | 
 | 54 | +    strategy:  | 
 | 55 | +      fail-fast: false  | 
 | 56 | +      matrix:  | 
 | 57 | +        # Add macos-latest and/or windows-latest if relevant for this package.  | 
 | 58 | +        os: [ubuntu-latest]  | 
 | 59 | +        sdk: [3.4, dev]  | 
 | 60 | +    steps:  | 
 | 61 | +      - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938  | 
 | 62 | +      - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672  | 
 | 63 | +        with:  | 
 | 64 | +          sdk: ${{ matrix.sdk }}  | 
 | 65 | +      - id: install  | 
 | 66 | +        name: Install dependencies  | 
 | 67 | +        run: dart pub get  | 
 | 68 | +      - name: Run VM tests  | 
 | 69 | +        run: dart test --platform vm  | 
 | 70 | +        if: always() && steps.install.outcome == 'success'  | 
 | 71 | +      - name: Run Chrome tests  | 
 | 72 | +        run: dart test --platform chrome  | 
 | 73 | +        if: always() && steps.install.outcome == 'success'  | 
 | 74 | +      - name: Run Chrome tests - wasm  | 
 | 75 | +        # TODO: investigate why we get hangs when concurrency is > 1  | 
 | 76 | +        run: dart test --platform chrome --compiler dart2wasm -j 1  | 
 | 77 | +        if: always() && steps.install.outcome == 'success'  | 
0 commit comments