2022-08-26 12:35:41 +00:00
|
|
|
name: Test
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Prepare repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
flutter-version: '3.0.5'
|
|
|
|
channel: 'stable'
|
|
|
|
- name: Install Flutter
|
|
|
|
uses: subosito/flutter-action@v2
|
2022-08-26 12:43:39 +00:00
|
|
|
- name: Checkout submodules
|
|
|
|
run: git submodule update --init --recursive
|
2022-08-26 12:35:41 +00:00
|
|
|
- name: Get dependencies
|
|
|
|
run: flutter pub get
|
2022-08-26 13:06:50 +00:00
|
|
|
- name: Create temp files
|
|
|
|
id: secret-file1
|
|
|
|
run: |
|
2022-08-26 13:54:28 +00:00
|
|
|
$secretFileExchange = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "lib/external_api_keys.dart";
|
2022-08-26 13:06:50 +00:00
|
|
|
$encodedBytes = [System.Convert]::FromBase64String($env:CHANGE_NOW);
|
2022-08-26 13:54:28 +00:00
|
|
|
Set-Content $secretFileExchange -Value $encodedBytes -AsByteStream;
|
|
|
|
$secretFileExchangeHash = Get-FileHash $secretFileExchange;
|
|
|
|
Write-Output "::set-output name=SECRET_FILE_EXCHANGE::$secretFileExchange";
|
|
|
|
Write-Output "::set-output name=SECRET_FILE_EXCHANGE_HASH::$($secretFileExchangeHash.Hash)";
|
|
|
|
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 "::set-output name=SECRET_FILE_BITCOIN::$secretFileBitcoin";
|
|
|
|
Write-Output "::set-output name=SECRET_FILE_BITCOIN_HASH::$($secretFileBitcoinHash.Hash)";
|
|
|
|
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 "::set-output name=SECRET_FILE_DOGECOIN::$secretFileDogecoin";
|
|
|
|
Write-Output "::set-output name=SECRET_FILE_DOGECOIN_HASH::$($secretFileDogecoinHash.Hash)";
|
|
|
|
Write-Output "Secret file $secretFileDogecoin has hash $($secretFileDogecoinHash.Hash)";
|
2022-08-26 13:06:50 +00:00
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
|
2022-08-26 13:54:28 +00:00
|
|
|
BITCOIN_TEST: ${{ secrets.BITCOIN_TEST }}
|
|
|
|
DOGECOIN_TEST: ${{ secrets.DOGECOIN_TEST }}
|
2022-08-26 13:59:46 +00:00
|
|
|
# - name: Analyze
|
|
|
|
# run: flutter analyze
|
2022-08-26 12:35:41 +00:00
|
|
|
- name: Test
|
|
|
|
run: flutter test
|
2022-08-26 13:06:50 +00:00
|
|
|
- name: Delete temp files
|
|
|
|
run: |
|
|
|
|
Remove-Item -Path $env:CHANGE_NOW;
|
2022-08-26 13:54:28 +00:00
|
|
|
Remove-Item -Path $env:BITCOIN_TEST;
|
|
|
|
Remove-Item -Path $env:DOGECOIN_TEST;
|
2022-08-26 13:06:50 +00:00
|
|
|
shell: pwsh
|
|
|
|
if: always()
|
|
|
|
env:
|
2022-08-26 13:54:28 +00:00
|
|
|
CHANGE_NOW: ${{ steps.secret-file1.outputs.SECRET_FILE_EXCHANGE }}
|
|
|
|
BITCOIN_TEST: ${{ steps.secret-file1.outputs.SECRET_FILE_BITCOIN }}
|
|
|
|
DOGECOIN_TEST: ${{ steps.secret-file1.outputs.SECRET_FILE_DOGECOIN }}
|