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

DRAFT - Run Caraya Tests in CI-CD #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: ci-checks

on:
workflow_dispatch:

env:
LABVIEW_VERSION: 24.0
LABVIEW_BITNESS: 64
DOCKER_USER: "runner"

jobs:

caraya-tests:

runs-on:
- ubuntu-latest

container:
image: ghcr.io/vipm-io/actions-runner-labview-2024-linux:main
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}

steps:
- uses: actions/checkout@v4
with:
clean: false
set-safe-directory: false
persist-credentials: false

- name: Caraya Tests
shell: bash
run: |
echo "Applying VIPC Starting Display..."
source /usr/bin/start_display
echo "Refreshing Package List..."
dragon refresh --vipm
echo "Applying VIPC file..."
dragon vipm apply-vipc --labview-version ${{ env.LABVIEW_VERSION }} --labview-bitness ${{ env.LABVIEW_BITNESS }} --timeout 600 ./source/.vipc
if [ -f "./Tooling/coverage.vi" ]; then
echo "Calculating Test Coverage..."
g-cli --timeout 600000 "./Tooling/coverage.vi"
fi
echo "Running unit tests..."
g-cli --timeout 600000 Caraya -- -s "tests" -x "report.xml" -v true -r true

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: caraya-test-report
path: |
./report.xml
./codecov.json

- name: Caraya Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
check_name: Caraya Test Report
report_paths: report.xml

- run: |
# these files mess up the codecov report uploader, so remove them
rm -f report.xml
rm -f "build support/coverage.vi"

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CI: true
with:
# fail_ci_if_error: true # optional (default = false)
# name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
verbose: true # optional (default = false)
flags: unittests
files: "./codecov.json"