Skip to content

Integrate Open CryptoPay payment standard #2176

Integrate Open CryptoPay payment standard

Integrate Open CryptoPay payment standard #2176

Workflow file for this run

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