Don't use conan credentials for unit-tests #4
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: unit-test | ||
on: | ||
workflow_call: | ||
inputs: | ||
test_use_ctest: | ||
required: false | ||
default: false | ||
type: boolean | ||
permissions: | ||
contents: read | ||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
# FIXME: use main once merged | ||
steps: | ||
- name: Setup the build environment | ||
uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@CURA-11622_conan_v2 | ||
with: | ||
install_system_dependencies: true | ||
- name: Install dependencies and build unit test | ||
run: conan build . -s build_type=Release --build=missing --update -g GitHubActionsRunEnv -g GitHubActionsBuildEnv -c tools.build:skip_test=False | ||
- name: Run ctest-based unit test | ||
if: ${{ inputs.test_use_ctest }} | ||
id: run-test | ||
run: ctest --output-junit unit_tests_results.xml | ||
working-directory: build/Release/tests | ||
- name: Save PR metadata | ||
if: always() | ||
run: | | ||
echo ${{ github.event.number }} > pr-id.txt | ||
echo ${{ github.event.pull_request.head.repo.full_name }} > pr-head-repo.txt | ||
echo ${{ github.event.pull_request.head.ref }} > pr-head-ref.txt | ||
working-directory: ${{ inputs.unit_test_dir }} | ||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-result | ||
path: | | ||
${{ inputs.unit_test_dir }}/**/unit_tests_results.xml | ||
${{ inputs.unit_test_dir }}/pr-id.txt | ||
${{ inputs.unit_test_dir }}/pr-head-repo.txt | ||
${{ inputs.unit_test_dir }}/pr-head-ref.txt |