Skip to content

Commit

Permalink
Add test-client workflow
Browse files Browse the repository at this point in the history
On push trigger for now to test it.
Can be trigger manually to test that the mithril-client can list,
download and restore on each supported environment.
  • Loading branch information
Alenar committed Dec 1, 2022
1 parent de9f2c2 commit 1b1934d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Mithril Client multi-platform test

#on: workflow_dispatch
on: push

jobs:
test:
strategy:
fail-fast: false
matrix:
# os: [ ubuntu-22.04, macos-12, windows-latest ]
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
path: sources/

- name: Prepare environment variables
id: prepare
run: |
echo "sha=$(git ls-remote {{ github.repositoryUrl }} refs/heads/main | cut -f 1)" >> $GITHUB_OUTPUT
echo "NETWORK=preview" >> $GITHUB_ENV
echo "AGGREGATOR_ENDPOINT=https://aggregator.pre-release-preview.api.mithril.network/aggregator" >> $GITHUB_ENV
echo "GENESIS_VERIFICATION_KEY=$(wget -q -O - https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey)" >> $GITHUB_ENV
- name: Checkout binary
uses: dawidd6/action-download-artifact@v2
with:
name: mithril-distribution-Linux-X64
path: ./
commit: ${{ steps.prepare.outputs.sha }}
workflow: ci.yml
workflow_conclusion: success

- name: Set permissions
run: |
chmod +x ./mithril-client
ls -l
- name: List and get last snapshot digest
run: |
./mithril-client list
echo "SNAPSHOT_DIGEST=$(./mithril-client list --json | jq -r ".[0].digest)" >> $GITHUB_ENV
- name: Download Latest Snapshot
run: ./mithril-client download $SNAPSHOT_DIGEST

- name: Restore Latest Snashot
run: ./mithril-client restore $SNAPSHOT_DIGEST

0 comments on commit 1b1934d

Please sign in to comment.