-
Notifications
You must be signed in to change notification settings - Fork 60
124 lines (116 loc) · 6.86 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#should deny
name: Test
on: [pull_request]
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Prepare repository
uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.6'
channel: 'stable'
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- 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
sudo apt clean
sudo apt update
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 debhelper libclang-dev opencl-headers libssl-dev ocl-icd-opencl-dev libc6-dev-i386
- 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_monero_all.sh
- name: Build Epic Cash
run: |
cd crypto_plugins/flutter_libepiccash/scripts/linux/
./build_all.sh
- 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: Analyze
# run: flutter analyze
- name: Test
run: flutter test --coverage
- name: Upload to code coverage
uses: codecov/[email protected]
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()