docs: move HMAC importRawKey example to file (#293) #666
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: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PUB_ENVIRONMENT: bot.github | |
| jobs: | |
| lints: | |
| name: Format + Lints | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - run: flutter pub get | |
| - run: dart format --output none --set-exit-if-changed . | |
| - run: dart analyze --fatal-warnings . | |
| linux: | |
| name: Linux desktop / Chrome / Firefox | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - name: Configure Flutter | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y ninja-build libgtk-3-dev | |
| flutter config --no-analytics | |
| - run: flutter pub get | |
| - run: xvfb-run dart test --exclude-tags browser-interop -p vm,chrome,firefox -c dart2js,dart2wasm --coverage ./coverage | |
| - run: xvfb-run flutter test integration_test/webcrypto_test.dart -d linux | |
| working-directory: ./example/webcrypto_demo_flutter_app | |
| # Report collected coverage | |
| - name: Convert coverage to lcov | |
| run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/ | |
| - uses: coverallsapp/github-action@v2 | |
| linux-dart: | |
| name: Linux Dart / Chrome / Firefox | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Install Valgrind | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y valgrind | |
| - run: dart pub get --no-example | |
| - run: xvfb-run dart test --exclude-tags browser-interop -p vm,chrome,firefox -c dart2js,dart2wasm | |
| macos: | |
| name: MacOS desktop / Chrome | |
| runs-on: macos-15 # Test with xcode 16 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - name: Configure Flutter | |
| run: | | |
| flutter config --no-analytics | |
| - run: flutter pub get | |
| - run: dart test --exclude-tags browser-interop -p vm,chrome -c dart2js,dart2wasm | |
| - run: flutter test integration_test/webcrypto_test.dart -d macos --timeout 5m | |
| working-directory: ./example/webcrypto_demo_flutter_app | |
| windows: | |
| name: Windows desktop / Chrome / Firefox | |
| runs-on: windows-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: ilammy/setup-nasm@v1 | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - name: Configure Flutter | |
| run: | | |
| flutter config --no-analytics | |
| - run: flutter pub get | |
| - run: dart test --exclude-tags browser-interop -p vm,chrome,firefox | |
| - run: flutter test integration_test/webcrypto_test.dart -d windows | |
| working-directory: ./example/webcrypto_demo_flutter_app | |
| ios: | |
| name: iOS emulator (iPhone) | |
| runs-on: macos-14 | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - name: Configure Flutter | |
| run: | | |
| flutter config --no-analytics | |
| - uses: futureware-tech/simulator-action@v3 | |
| with: | |
| model: 'iPhone 15' | |
| - run: flutter pub get | |
| - name: Run integration tests | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 20 | |
| max_attempts: 2 | |
| command: cd example/webcrypto_demo_flutter_app && flutter test integration_test/webcrypto_test.dart -d iphone --timeout 60s | |
| android: | |
| name: Android emulator | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 21 | |
| - name: Configure Flutter | |
| run: | | |
| flutter config --no-analytics | |
| - run: flutter pub get | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-ubuntu-api36-google_apis-x86_64 | |
| - name: Create AVD snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 36 | |
| target: google_apis | |
| arch: x86_64 | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim | |
| working-directory: ./example/webcrypto_demo_flutter_app | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: Run flutter test integration_test/webcrypto_test.dart -d emulator | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 36 | |
| target: google_apis | |
| arch: x86_64 | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim | |
| working-directory: ./example/webcrypto_demo_flutter_app | |
| script: >- | |
| flutter test integration_test/webcrypto_test.dart -d emulator --timeout 5m || | |
| flutter test integration_test/webcrypto_test.dart -d emulator --timeout 5m || | |
| flutter test integration_test/webcrypto_test.dart -d emulator --timeout 5m |