From 88a6cce6627e3493996c99a87d883d3f6945d91c Mon Sep 17 00:00:00 2001 From: levisingularity Date: Mon, 18 Nov 2024 10:29:13 -0300 Subject: [PATCH] das-119: enable workflow dispatch and workflow call trigger --- .github/workflows/build.yml | 56 +++------------------------------ .github/workflows/run-tests.yml | 4 +++ 2 files changed, 8 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fca7e2..737439f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,60 +29,12 @@ jobs: - name: Push to DockerHub run: docker push trueagi/das:latest-jupyter-notebook - build-das-cli: - runs-on: ubuntu-22.04 + build-and-run-tests: if: github.ref == 'refs/heads/master' - needs: build-jupyter-notebook - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build Dockerfile - run: docker build -f .docker/Dockerfile.das-toolbox -t das-cli:latest . - - - name: Build das-cli binary - run: docker run --rm -v "$(pwd)/dist/":/app/das/dist -e DAS_CLI_VERSION=${{ github.event.inputs.version }} das-cli:latest - - - name: Upload das-cli artifact - uses: actions/upload-artifact@v4 - with: - name: das-cli - path: dist/* - - integration-tests: - runs-on: ubuntu-22.04 - needs: - - build-das-cli - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Install requirements - run: |- - sudo apt -y update && sudo apt -y install make - cd /tmp - git clone --depth=1 --branch v1.11.0 https://github.com/bats-core/bats-core.git - cd bats-core - sudo ./install.sh /usr/local - cd - - - - name: Download das-cli artifact - uses: actions/download-artifact@v4 - with: - name: das-cli - path: packages - - - name: Installing das-cli package - run: sudo apt -y install $(find . -name *.deb -type f | head -n 1) - - - name: Runnign integration tests - run: make integration_tests + uses: ./.github/workflows/run-tests.yml tag: - needs: - - integration-tests + needs: build-and-run-tests if: github.ref == 'refs/heads/master' uses: singnet/das/.github/workflows/run-semver.yml@master with: @@ -100,7 +52,7 @@ jobs: deploy-das-cli: runs-on: ubuntu-22.04 if: github.ref == 'refs/heads/master' - needs: integration-tests + needs: build-and-run-tests steps: - name: Set up SSH run: | diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b86ce34..71686c9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,6 +2,10 @@ name: Run DAS-CLI tests on: + workflow_dispatch: + + workflow_call: + pull_request: types: - opened