ci: add --quiet flag to nix commands #53
This file contains hidden or 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: E2E Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| integration-tests: | |
| name: Run moog E2E tests | |
| runs-on: ubuntu-latest | |
| env: | |
| MOOG_MPFS_HOST: "http://localhost:3000" | |
| MOOG_TEST_YACI_ADMIN: "http://localhost:10000" | |
| MOOG_GITHUB_PAT: ${{ secrets.MOOG_GITHUB_PAT }} | |
| MOOG_WALLET_FILE: "wallet.json" | |
| MOOG_TEST_REQUESTER_WALLET: "wallet.json" | |
| MOOG_TEST_ORACLE_WALLET: "wallet.json" | |
| MOOG_TEST_AGENT_WALLET: "wallet.json" | |
| MOOG_WAIT: 2 | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4.3.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup cfhal wallet | |
| run: | | |
| # This is the real cfhal wallet as its public key is registerered | |
| # in Github as user authentication | |
| echo ${{ secrets.MOOG_REQUESTER_WALLET }} | base64 -d > "$MOOG_WALLET_FILE" | |
| - name: Set up Docker Compose | |
| uses: docker/setup-compose-action@v1 # Or hoverkraft-tech/compose-action for more options | |
| - name: Start mpfs on a local preprod Yaci cluster | |
| run: docker compose -f test-E2E/fixtures/docker-compose.yml up -d | |
| - name: Wait for mpfs to be ready | |
| run: | | |
| echo "Waiting for mpfs to be ready..." | |
| while [[ "$(curl -s "$MOOG_MPFS_HOST/tokens" | jq -r '.indexerStatus.ready')" != "true" ]]; do | |
| echo "Waiting for mpfs to be ready..." | |
| sleep 2 | |
| done | |
| - uses: paolino/dev-assets/setup-nix@v0.0.1 | |
| with: | |
| cachix-auth-token: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
| - name: Fund the wallet | |
| run: | | |
| nix --quiet shell -c moog wallet create -w "$MOOG_WALLET_FILE" | |
| address=$(nix --quiet shell -c moog wallet info | jq -r '.address') | |
| topup(){ | |
| curl -s -X 'POST' \ | |
| "$MOOG_TEST_YACI_ADMIN/local-cluster/api/addresses/topup" \ | |
| -H 'accept: */*' \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ | |
| "address": "'"$address"'", | |
| "adaAmount": 10000 | |
| }' | |
| } | |
| while true; do | |
| if topup | grep -q "Topup successful"; then | |
| break | |
| fi | |
| echo "Retrying topup..." | |
| sleep 2 | |
| done | |
| - name: Export agent PKH | |
| run: | | |
| owner=$(nix --quiet shell -c moog wallet info | jq -r '.owner') | |
| echo "MOOG_AGENT_PUBLIC_KEY_HASH=$owner" >> $GITHUB_ENV | |
| - name: Run E2E tests | |
| run: nix --quiet shell -c nix --quiet run .#e2e-tests | |
| - name: Tear down | |
| if: always() | |
| run: docker compose -f test-E2E/fixtures/docker-compose.yml down |