Skip to content

Commit

Permalink
das-119: enable workflow dispatch and workflow call trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
levisingularity committed Nov 18, 2024
1 parent adc3251 commit 88a6cce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 52 deletions.
56 changes: 4 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name: Run DAS-CLI tests

on:
workflow_dispatch:

workflow_call:

pull_request:
types:
- opened
Expand Down

0 comments on commit 88a6cce

Please sign in to comment.