Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[das#119]: Enable workflow dispatch and workflow call trigger #135

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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