Skip to content

[DAS-Toolbox #1148] Update DB-Loader #552

[DAS-Toolbox #1148] Update DB-Loader

[DAS-Toolbox #1148] Update DB-Loader #552

---
name: Perform Lint and run tests
on:
workflow_dispatch:
inputs:
version:
required: false
description: DAS-TOOLBOX version
type: string
workflow_call:
inputs:
version:
required: false
description: DAS-TOOLBOX version
type: string
run-agent-integration-tests:
required: false
description: Whether to run agent integration tests
type: boolean
default: false
binary-artifact-name:
required: false
description: Specifies the name of the binary artifact to be generated or used. Default is 'das-toolbox'.
type: string
default: das-toolbox
pull_request:
types:
- opened
- reopened
- edited
- synchronize
jobs:
lint:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ~3.11
cache: pip
- name: Install dev requirements
run: pip install -r src/requirements-dev.txt
working-directory: das-cli
- name: Run lint
run: make lint
working-directory: das-cli
build-das-toolbox:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build DAS-TOOLBOX
run: PACKAGE_VERSION=${{github.event.inputs.version || '0.1.0'}} make build
- id: upload-artifact
name: Upload das-toolbox artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.event.inputs.binary-artifact-name || 'das-toolbox' }}
path: dist/*
if-no-files-found: "error"
das-cli-integration-tests:
runs-on: self-hosted
needs:
- build-das-toolbox
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Download das-toolbox artifact
uses: actions/download-artifact@v4
with:
name: ${{github.event.inputs.binary-artifact-name || 'das-toolbox'}}
path: dist
- name: Installing das-toolbox package
run: |-
sudo apt -y --autoremove --purge remove das-toolbox || true
sudo apt -y --allow-downgrades install ./$(find . -name *.deb -type f | head -n 1)
- name: Install requirements
run: |-
if [ -d "/tmp/bats-core" ]; then
sudo rm -rf /tmp/bats-core
fi
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 -
sudo apt -y update && sudo apt -y install socat lsof
- name: Running integration tests
run: make tests-local
working-directory: das-cli
# agents-integration-tests:
# runs-on: self-hosted
# needs:
# - das-cli-integration-tests
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ~3.11
# cache: pip
# - name: Download das-toolbox artifact
# uses: actions/download-artifact@v4
# with:
# name: ${{ github.event.inputs.binary-artifact-name || 'das-toolbox' }}
# path: dist
# - name: Install das-toolbox package
# run: |-
# sudo apt -y --autoremove --purge remove das-toolbox || true
# sudo apt -y install ./$(find dist -name "*.deb" -type f | head -n 1)
# - name: Install Python dependencies
# run: pip install -r src/requirements-dev.txt
# working-directory: das-cli
# - name: Run agents integration tests (pytest)
# run: make tests-integration
# working-directory: das-cli