forked from holgerBerger/hpc-workspace-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial action to run CLI tests with Bats
Signed-off-by: Christoph Niethammer <[email protected]>
- Loading branch information
1 parent
c98faae
commit c22834e
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: "Bats CLI tests" | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
analyze: | ||
name: CLI tests | ||
runs-on: 'ubuntu-latest' | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
|
||
# required to fetch internal or private CodeQL packs | ||
packages: read | ||
|
||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- cmake_preset: ["debug", "release"] | ||
|
||
steps: | ||
- name: Install additional OS package dependencies to build hpc-workspace | ||
run: | | ||
sudo apt install \ | ||
libboost-system-dev \ | ||
libboost-program-options-dev \ | ||
libcap-dev | ||
- name: Install Bats and its support libraries for testing | ||
run: | | ||
sudo apt install \ | ||
bats \ | ||
bats-assert \ | ||
bats-file | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch external sources | ||
run: | | ||
cd external | ||
./get_externals.sh | ||
- name: Configure and build code | ||
run: | | ||
cmake --preset ${{ matrix.cmake_preset }} | ||
cmake --build --preset ${{ matrix.cmake_preset }} | ||
- name: Run bats non-sudo tests | ||
run: | | ||
bats --filter-tag \!sudo bats/test/ | ||
- name: Run bats sudo tests | ||
run: | | ||
sudo bats --filter-tag sudo bats/test/ | ||
with: | ||
output: bats-results | ||
upload: failure-only | ||
|
||
- name: Upload full loc as a Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bats-results | ||
path: bats-results | ||
retention-days: 1 |