Fix tests CI workflow #2052
Workflow file for this run
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
| #should deny | |
| name: Test | |
| on: [pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Prepare repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.38.1' | |
| channel: 'stable' | |
| # - name: Setup | Rust | |
| # uses: dtolnay/rust-toolchain@stable | |
| # with: | |
| # components: clippy | |
| - name: Checkout submodules | |
| run: git submodule update --init --recursive | |
| - name: install dependencies | |
| run: | | |
| cargo install cargo-ndk | |
| rustup install 1.85.1 1.89.0 | |
| rustup target add x86_64-unknown-linux-gnu --toolchain 1.89.0 | |
| sudo apt update | |
| sudo apt install -y meson ninja-build libglib2.0-dev libgcrypt20-dev libgirepository1.0-dev unzip automake build-essential file pkg-config git python3 libtool cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm debhelper libclang-dev opencl-headers libssl-dev ocl-icd-opencl-dev libc6-dev-i386 valac libtss2-dev | |
| # - name: Build Epic Cash | |
| #run: | | |
| #cd crypto_plugins/flutter_libepiccash/scripts/linux/ | |
| #./build_all.sh | |
| - name: Configure app | |
| run: | | |
| cd scripts | |
| echo "yes" | ./build_app.sh -v "0.0.1" -b "1" -p "linux" -a "stack_wallet" | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Create git_versions.dart stubs | |
| run: | | |
| mkdir -p crypto_plugins/flutter_libepiccash/lib | |
| mkdir -p crypto_plugins/flutter_libmwc/lib | |
| cat > crypto_plugins/flutter_libepiccash/lib/git_versions.dart << 'EOF' | |
| String getPluginVersion() => "stub-for-tests"; | |
| EOF | |
| cat > crypto_plugins/flutter_libmwc/lib/git_versions.dart << 'EOF' | |
| String getPluginVersion() => "stub-for-tests"; | |
| EOF | |
| - name: Decode secrets | |
| env: | |
| CHANGE_NOW: ${{ secrets.CHANGE_NOW }} | |
| run: | | |
| echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart | |
| - name: Create test stubs | |
| run: bash scripts/prebuild.sh | |
| - name: Regenerate mocks | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| - name: Check formatting of changed files | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| BASE=$(git merge-base ${{ github.event.pull_request.base.sha }} HEAD) | |
| else | |
| BASE=${{ github.event.before }} | |
| fi | |
| FILES=$(git diff --name-only --diff-filter=ACM "$BASE"..HEAD -- '*.dart') | |
| if [ -z "$FILES" ]; then | |
| echo "No Dart files changed." | |
| exit 0 | |
| fi | |
| echo "Checking formatting of $(echo "$FILES" | wc -l) file(s):" | |
| echo "$FILES" | |
| dart format --output=none --set-exit-if-changed $FILES | |
| # - name: Analyze | |
| # run: flutter analyze | |
| - name: Test | |
| run: flutter test --coverage | |
| - name: Upload to code coverage | |
| uses: codecov/codecov-action@v1.2.2 | |
| if: success() || failure() | |
| with: | |
| token: ${{secrets.CODECOV_TOKEN}} | |
| file: coverage/lcov.info |