Start to build using Makefiles #2210
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: [pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: read | |
| container: | |
| image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:test | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| steps: | |
| - name: Prepare repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Configure app | |
| run: | | |
| cd scripts | |
| echo "yes" | ./build_app.sh -v "0.0.1" -b "1" -p "linux" -a "stack_wallet" -d -s | |
| - 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: Ensure app config for tests | |
| run: bash scripts/ensure_test_app_config.sh | |
| - name: Create test stubs | |
| run: bash prebuild.sh | |
| working-directory: scripts | |
| - 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: | | |
| bash scripts/ensure_test_app_config.sh | |
| test -s lib/app_config.g.dart | |
| grep -Fq "part of 'app_config.dart';" lib/app_config.g.dart | |
| 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 | |
| macos-fresh-build: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Prepare repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.38.1' | |
| channel: 'stable' | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install macOS build dependencies | |
| run: ./scripts/install_macos_build_tools.sh | |
| - name: Select Xcode | |
| run: | | |
| XCODE_PATH=$(find /Applications -maxdepth 1 -name 'Xcode*.app' -type d | head -1) | |
| if [ -n "$XCODE_PATH" ]; then | |
| sudo xcode-select --switch "$XCODE_PATH" | |
| echo "Using Xcode at: $XCODE_PATH" | |
| else | |
| echo "Xcode not found" && exit 1 | |
| fi | |
| - name: Fresh clone smoke build (macOS) | |
| run: make build-macos VERSION=0.0.1 BUILD_NUM=1 | |
| - name: MWC FFI integration test | |
| run: make test-mwc |