[#146] DAS-CLI pipeline refactoring #147
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Perform Lint and run tests | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: false | |
description: DAS-CLI version | |
type: string | |
workflow_call: | |
inputs: | |
version: | |
required: false | |
description: DAS-CLI version | |
type: string | |
binary-artifact-name: | |
required: false | |
description: Specifies the name of the binary artifact to be generated or used. Default is 'das-cli'. | |
type: string | |
default: das-cli | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- edited | |
- synchronize | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ~3.10 | |
cache: pip | |
- name: Install requirements | |
run: pip install -r src/requirements.txt | |
- name: | |
run: make lint | |
build-das-cli: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build DAS-CLI | |
run: DAS_CLI_VERSION=${{github.event.inputs.version || '0.1.0'}} make build | |
- id: upload-artifact | |
name: Upload das-cli artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{inputs.binary-artifact-name}} | |
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: ${{inputs.binary-artifact-name}} | |
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 |