Version 1.22.0 #258
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [v1] | |
| paths: | |
| - lib/** | |
| - test/** | |
| - test_integration/** | |
| - pubspec.yaml | |
| - dart_test.yaml | |
| - analysis_options.yaml | |
| - .github/workflows/test.yml | |
| pull_request: | |
| branches: [v1] | |
| paths: | |
| - lib/** | |
| - test/** | |
| - test_integration/** | |
| - pubspec.yaml | |
| - dart_test.yaml | |
| - analysis_options.yaml | |
| - .github/workflows/test.yml | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool/package_config.json | |
| key: ${{ runner.os }}-test-${{ hashFiles('**/pubspec.lock') }} | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Verify formatting | |
| run: dart format --output=none --set-exit-if-changed . | |
| - name: Analyze project source | |
| run: dart analyze --fatal-infos | |
| test: | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| sdk: ['stable', '2.14', 'beta'] | |
| platform: ['vm', 'node'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool/package_config.json | |
| key: ${{ runner.os }}-test-${{ hashFiles('**/pubspec.lock') }} | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Run tests | |
| run: dart test -p ${{ matrix.platform }} | |
| integration: | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| sdk: ['stable', '2.14'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| .dart_tool/package_config.json | |
| key: ${{ runner.os }}-test-${{ hashFiles('**/pubspec.lock') }} | |
| - name: Run tests | |
| run: | | |
| cd test_integration | |
| dart pub get | |
| dart run main.dart | |
| coverage: | |
| if: github.repository == 'bitanon/hashlib' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Install global packages | |
| run: | | |
| dart pub global activate coverage | |
| dart pub global activate cobertura | |
| dart pub global activate junitreport | |
| - name: Generate coverage | |
| run: bash ./scripts/coverage.sh | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage/cobertura.xml | |
| - name: Upload test results | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage/junit.xml |