diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 8dd62a87..4020bdcc 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -4,3 +4,7 @@ on: [pull_request] jobs: run-tests: uses: ./.github/workflows/tests.yaml + secrets: + BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} + BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} + BUILD_KEY: ${{ secrets.BUILD_KEY }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index dad74f78..0e70dd1c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,6 +5,10 @@ on: jobs: run-tests: uses: ./.github/workflows/tests.yaml + secrets: + BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} + BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} + BUILD_KEY: ${{ secrets.BUILD_KEY }} build: name: Run docker build runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b5abb2e5..2bf9220b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,6 +1,13 @@ name: Test the stack. on: workflow_call: + secrets: + BUILD_HOSTNAME: + required: true + BUILD_USERNAME: + required: true + BUILD_KEY: + required: true jobs: build: @@ -45,6 +52,7 @@ jobs: - name: Trigger Unit Test run: | + ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} go install github.com/onsi/ginkgo/v2/ginkgo@latest ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} chmod +x /tmp/run_unit_test.sh /tmp/run_unit_test.sh ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh @@ -112,10 +120,6 @@ jobs: -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ --env-file "$GITHUB_WORKSPACE/config.sh" \ up -d --build - - name: Install packages - run: | - go install github.com/onsi/ginkgo/v2/ginkgo@latest - which ginkgo - name: Test run: | cd $GITHUB_WORKSPACE/ipld-eth-server @@ -177,10 +181,6 @@ jobs: -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ --env-file "$GITHUB_WORKSPACE/config.sh" \ up -d --build - - name: Install packages - run: | - go install github.com/onsi/ginkgo/v2/ginkgo@latest - which ginkgo - name: Test run: | cd $GITHUB_WORKSPACE/ipld-eth-server diff --git a/Makefile b/Makefile index f023c2e1..d99a52fc 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PKGS = go list ./... | grep -v "^vendor/" ## Testing library GINKGO = $(BIN)/ginkgo $(BIN)/ginkgo: - go get -u github.com/onsi/ginkgo/ginkgo + go run github.com/onsi/ginkgo/ginkgo ## Migration tool GOOSE = $(BIN)/goose