Enhance rpc tests and clean up structure #935
Workflow file for this run
This file contains 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: TestSuite | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
REJECT_SEED: ${{ secrets.REJECT_SEED }} | |
TRON_SEED: ${{ secrets.TRON_SEED }} | |
ETHERSCAN_API_KEYS: ${{ secrets.ETHERSCAN_API_KEYS }} | |
TRONSCAN_API_KEYS: ${{ secrets.TRONSCAN_API_KEYS }} | |
DEV_SEED: ${{ secrets.DEV_SEED }} | |
jobs: | |
lint: | |
name: Static code analysis and run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pub-cache | |
.dart_tool | |
packages/bip39/.dart_tool | |
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: ${{ runner.os }}-dart- | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: "stable" | |
- name: Print Dart version | |
run: dart --version | |
- name: Get dependencies | |
run: | | |
dart pub get | |
(cd packages/bip39 && dart pub get) | |
- name: Dart analyze | |
run: dart analyze | |
test: | |
needs: lint | |
name: ${{ matrix.test-path }} tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test-path: | |
[ | |
"test/ci/amount", | |
"test/ci/derivation", | |
"test/ci/evm", | |
"test/ci/external_transactions", | |
"test/ci/fetching", | |
"test/ci/proof_of_payment", | |
"test/ci/sending", | |
"test/ci/tron", | |
] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pub-cache | |
.dart_tool | |
packages/bip39/.dart_tool | |
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: ${{ runner.os }}-dart- | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: "stable" | |
- name: Get dependencies | |
run: | | |
dart pub get | |
(cd packages/bip39 && dart pub get) | |
- name: Run CI tests | |
run: | | |
echo "::group::Running tests for ${{ matrix.test-path }}" | |
dart test ${{ matrix.test-path }} | |
echo "::endgroup::" | |
generate-docs: | |
if: github.ref == 'refs/heads/main' | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Required for pushing to gh-pages | |
pages: write # Required for deploying to Pages | |
id-token: write # Required for authentication | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pub-cache | |
.dart_tool | |
packages/bip39/.dart_tool | |
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: ${{ runner.os }}-dart- | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: "stable" | |
- name: Get dependencies | |
run: | | |
cd packages/bip39 | |
dart pub get | |
cd ../.. | |
dart pub get | |
- name: Install dartdoc | |
run: dart pub global activate dartdoc | |
- name: Generate API docs | |
run: dart pub global run dartdoc | |
- name: Prepare docs directory | |
run: | | |
rm -rf docs | |
mkdir -p docs | |
cp -R doc/api/* docs/ | |
- name: Deploy to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
force_orphan: true | |
commit_message: "docs: update documentation" | |
enable_jekyll: false | |
full_commit_message: "docs: update API documentation" |