stack_wallet/.github/workflows/test.yaml

132 lines
7.4 KiB
YAML
Raw Normal View History

2022-08-28 14:21:24 +00:00
#should deny
2022-08-26 12:35:41 +00:00
name: Test
2022-08-29 15:31:29 +00:00
on: [pull_request]
2022-08-26 12:35:41 +00:00
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Prepare repository
uses: actions/checkout@v3
with:
2022-10-18 19:43:40 +00:00
flutter-version: '3.3.4'
2022-08-26 12:35:41 +00:00
channel: 'stable'
- name: Install Flutter
uses: subosito/flutter-action@v2
- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
components: clippy
2022-08-26 12:43:39 +00:00
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: |
cargo install cargo-ndk
rustup target add x86_64-unknown-linux-gnu
2022-10-18 20:13:14 +00:00
sudo apt install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm
sudo apt install -y debhelper libclang-dev cargo rustc opencl-headers libssl-dev ocl-icd-opencl-dev
sudo apt install -y libc6-dev-i386
sudo apt install -y build-essential cmake git libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config llvm
sudo apt install -y build-essential debhelper cmake libclang-dev libncurses5-dev clang libncursesw5-dev cargo rustc opencl-headers libssl-dev pkg-config ocl-icd-opencl-dev
sudo apt install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless
2022-08-28 12:43:12 +00:00
- name: Build Lelantus
run: |
cd crypto_plugins/flutter_liblelantus/scripts/linux/
./build_all.sh
- name: Build Monero
run: |
cd crypto_plugins/flutter_libmonero/scripts/linux/
./build_all.sh
- name: Build Epic Cash
run: |
cd crypto_plugins/flutter_libepiccash/scripts/linux/
./build_all.sh
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 14:24:41 +00:00
$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 "::set-output name=SECRET_FILE_FIRO::$secretFileFiro";
Write-Output "::set-output name=SECRET_FILE_FIRO_HASH::$($secretFileFiroHash.Hash)";
Write-Output "Secret file $secretFileFiro has hash $($secretFileFiroHash.Hash)";
2022-09-27 15:09:28 +00:00
$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 "::set-output name=SECRET_FILE_BITCOINCASH::$secretFileBitcoinCash";
Write-Output "::set-output name=SECRET_FILE_BITCOINCASH_HASH::$($secretFileBitcoinCashHash.Hash)";
Write-Output "Secret file $secretFileBitcoinCash has hash $($secretFileBitcoinCashHash.Hash)";
2022-09-27 15:12:38 +00:00
$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;
2022-09-29 23:59:27 +00:00
Write-Output "::set-output name=SECRET_FILE_NAMECOIN::$secretFileNamecoin";
Write-Output "::set-output name=SECRET_FILE_NAMECOIN_HASH::$($secretFileNamecoinHash.Hash)";
2022-09-27 15:12:38 +00:00
Write-Output "Secret file $secretFileNamecoin has hash $($secretFileNamecoinHash.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 14:24:41 +00:00
FIRO_TEST: ${{ secrets.FIRO_TEST }}
2022-09-27 15:09:28 +00:00
BITCOINCASH_TEST: ${{ secrets.BITCOINCASH_TEST }}
2022-09-27 15:12:38 +00:00
NAMECOIN_TEST: ${{ secrets.NAMECOIN_TEST }}
2022-08-26 13:59:46 +00:00
# - name: Analyze
# run: flutter analyze
2022-08-26 12:35:41 +00:00
- name: Test
2022-08-28 13:06:19 +00:00
run: flutter test --coverage
- name: Upload to code coverage
uses: codecov/codecov-action@v1.2.2
2022-08-28 13:22:34 +00:00
if: success() || failure()
2022-08-28 13:06:19 +00:00
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage/lcov.info
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 14:24:41 +00:00
Remove-Item -Path $env:FIRO_TEST;
2022-09-27 15:09:28 +00:00
Remove-Item -Path $env:BITCOINCASH_TEST;
2022-09-27 15:12:38 +00:00
Remove-Item -Path $env:NAMECOIN_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 }}
2022-08-26 14:24:41 +00:00
FIRO_TEST: ${{ steps.secret-file1.outputs.SECRET_FILE_FIRO }}
2022-09-27 15:09:28 +00:00
BITCOINCASH_TEST: ${{ steps.secret-file1.outputs.SECRET_FILE_BITCOINCASH }}
2022-09-27 15:12:38 +00:00
NAMECOIN_TEST: ${{ steps.secret-file1.outputs.SECRET_FILE_NAMECOIN }}