Use stackwallet-ci image for test action workflow #2107
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
| name: Test | ||
| on: [pull_request] | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-24.04 | ||
| container: | ||
| image: ${{ secrets.DOCKERHUB_USERNAME }}/stackwallet-ci:latest | ||
| 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" | ||
| - name: Get dependencies | ||
| run: flutter pub get | ||
| - name: Create temp files | ||
| id: secret-file1 | ||
| run: | | ||
| $secretFileExchange = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "lib/external_api_keys.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:CHANGE_NOW); | ||
| Set-Content $secretFileExchange -Value $encodedBytes -AsByteStream; | ||
| $secretFileExchangeHash = Get-FileHash $secretFileExchange; | ||
| Write-Output "Secret file $secretFileExchange has hash $($secretFileExchangeHash.Hash)"; | ||
| $secretFileBitcoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoin/bitcoin_wallet_test_parameters.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:BITCOIN_TEST); | ||
| Set-Content $secretFileBitcoin -Value $encodedBytes -AsByteStream; | ||
| $secretFileBitcoinHash = Get-FileHash $secretFileBitcoin; | ||
| Write-Output "Secret file $secretFileBitcoin has hash $($secretFileBitcoinHash.Hash)"; | ||
| $secretFileDogecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/dogecoin/dogecoin_wallet_test_parameters.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:DOGECOIN_TEST); | ||
| Set-Content $secretFileDogecoin -Value $encodedBytes -AsByteStream; | ||
| $secretFileDogecoinHash = Get-FileHash $secretFileDogecoin; | ||
| Write-Output "Secret file $secretFileDogecoin has hash $($secretFileDogecoinHash.Hash)"; | ||
| $secretFileFiro = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/firo/firo_wallet_test_parameters.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:FIRO_TEST); | ||
| Set-Content $secretFileFiro -Value $encodedBytes -AsByteStream; | ||
| $secretFileFiroHash = Get-FileHash $secretFileFiro; | ||
| Write-Output "Secret file $secretFileFiro has hash $($secretFileFiroHash.Hash)"; | ||
| $secretFileBitcoinCash = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoincash/bitcoincash_wallet_test_parameters.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:BITCOINCASH_TEST); | ||
| Set-Content $secretFileBitcoinCash -Value $encodedBytes -AsByteStream; | ||
| $secretFileBitcoinCashHash = Get-FileHash $secretFileBitcoinCash; | ||
| Write-Output "Secret file $secretFileBitcoinCash has hash $($secretFileBitcoinCashHash.Hash)"; | ||
| $secretFileNamecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/namecoin/namecoin_wallet_test_parameters.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:NAMECOIN_TEST); | ||
| Set-Content $secretFileNamecoin -Value $encodedBytes -AsByteStream; | ||
| $secretFileNamecoinHash = Get-FileHash $secretFileNamecoin; | ||
| Write-Output "Secret file $secretFileNamecoin has hash $($secretFileNamecoinHash.Hash)"; | ||
| $secretFileParticl = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/particl/particl_wallet_test_parameters.dart"; | ||
| $encodedBytes = [System.Convert]::FromBase64String($env:PARTICL_TEST); | ||
| Set-Content $secretFileParticl -Value $encodedBytes -AsByteStream; | ||
| $secretFileParticlHash = Get-FileHash $secretFileParticl; | ||
| Write-Output "Secret file $secretFileParticl has hash $($secretFileParticlHash.Hash)"; | ||
| shell: pwsh | ||
| env: | ||
| CHANGE_NOW: ${{ secrets.CHANGE_NOW }} | ||
| BITCOIN_TEST: ${{ secrets.BITCOIN_TEST }} | ||
| DOGECOIN_TEST: ${{ secrets.DOGECOIN_TEST }} | ||
| FIRO_TEST: ${{ secrets.FIRO_TEST }} | ||
| BITCOINCASH_TEST: ${{ secrets.BITCOINCASH_TEST }} | ||
| NAMECOIN_TEST: ${{ secrets.NAMECOIN_TEST }} | ||
| PARTICL_TEST: ${{ secrets.PARTICL_TEST }} | ||
| - 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 | ||
| - name: Delete temp files | ||
| run: | | ||
| $secretFileExchange = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "lib/external_api_keys.dart"; | ||
| $secretFileBitcoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoin/bitcoin_wallet_test_parameters.dart"; | ||
| $secretFileDogecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/dogecoin/dogecoin_wallet_test_parameters.dart"; | ||
| $secretFileFiro = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/firo/firo_wallet_test_parameters.dart"; | ||
| $secretFileBitcoinCash = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoincash/bitcoincash_wallet_test_parameters.dart"; | ||
| $secretFileNamecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/namecoin/namecoin_wallet_test_parameters.dart"; | ||
| $secretFileParticl = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/particl/particl_wallet_test_parameters.dart"; | ||
| Remove-Item -Path $secretFileExchange; | ||
| Remove-Item -Path $secretFileBitcoin; | ||
| Remove-Item -Path $secretFileDogecoin; | ||
| Remove-Item -Path $secretFileFiro; | ||
| Remove-Item -Path $secretFileBitcoinCash; | ||
| Remove-Item -Path $secretFileNamecoin; | ||
| Remove-Item -Path $secretFileParticl; | ||
| shell: pwsh | ||
| if: always() | ||