From b40486887f06edd20fb7046e234afc35addbc949 Mon Sep 17 00:00:00 2001 From: canonbrother Date: Thu, 30 Nov 2023 10:44:00 +0800 Subject: [PATCH 1/2] wip --- .github/workflows/tests-ocean.yml | 94 +++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/tests-ocean.yml diff --git a/.github/workflows/tests-ocean.yml b/.github/workflows/tests-ocean.yml new file mode 100644 index 0000000000..33ddf23325 --- /dev/null +++ b/.github/workflows/tests-ocean.yml @@ -0,0 +1,94 @@ +name: Tests - Jellyfish Whale Apis + +on: + workflow_dispatch: + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +env: + MAKE_DEBUG: 0 + +jobs: + build: + runs-on: ubuntu-latest + container: defi/ain-builder:latest + env: + CARGO_INCREMENTAL: 0 + + steps: + - uses: actions/checkout@v4 + - run: git config --global --add safe.directory '*' + + - name: Populate environment + run: ./make.sh ci-export-vars + + - name: Setup dependencies + run: ./make.sh ci-setup-deps + + - name: Setup user dependencies + run: ./make.sh ci-setup-user-deps + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: lib -> ../build/lib/target + save-if: ${{ github.ref == 'refs/heads/master' }} + + - name: Build binaries + run: ./make.sh build + + - name: Upload binaries + uses: actions/upload-artifact@v3 + with: + name: defi-bins + path: build/src/defid + + - name: Build docker + run: "docker build -t test-build-container -f ./contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile ." + + - name: Upload docker + uses: actions/upload-artifact@v3 + with: + name: defi-docker + path: . + + test: + name: Jellyfish Whale Api tests + runs-on: ubuntu-latest + needs: build + + steps: + - uses: actions/checkout@v4 + with: + repository: birthdayresearch/jellyfishsdk + ref: 'main' + + - name: Download binaries + uses: actions/download-artifact@v3 + with: + name: defi-bins + + - name: Download docker + uses: actions/download-artifact@v3 + with: + name: defi-docker + + - name: Setup permissions + run: | + chmod uog+x "$(pwd)/defid" + + - uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: | + npm ci + + - name: Run tests + run: | + DEFICHAIN_DOCKER_IMAGE=test-build-container DEFID="$(pwd)/defid" npm t apps/whale-api/src/module.api From fd028ed7d253ac0acdc01845e49288c1bad1f44f Mon Sep 17 00:00:00 2001 From: canonbrother Date: Mon, 11 Dec 2023 16:58:54 +0800 Subject: [PATCH 2/2] fail-fast false --- .github/workflows/tests-ocean.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests-ocean.yml b/.github/workflows/tests-ocean.yml index 33ddf23325..362e42edb2 100644 --- a/.github/workflows/tests-ocean.yml +++ b/.github/workflows/tests-ocean.yml @@ -60,6 +60,8 @@ jobs: name: Jellyfish Whale Api tests runs-on: ubuntu-latest needs: build + strategy: + fail-fast: false steps: - uses: actions/checkout@v4