use windows style paths for msys? weird #1
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: Windows Acceptance Tests | ||
on: | ||
workflow_call | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
jobs: | ||
windows_acceptance_tests: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
install: >- | ||
dos2unix | ||
diffutils | ||
util-linux | ||
python-pip | ||
- name: Checkout Core | ||
uses: actions/checkout@v3 | ||
- name: install cf-remote | ||
run: pip install cf-remote | ||
# Note that msiexec can't install packages when running under msys; | ||
# But cf-remote currently can't run under powershell | ||
# (because it requires `pwd` module which is Unix-only). | ||
# Hence, we _download_ msi package using cf-remote under msys, | ||
# and install it by msiexec running under powershell. | ||
- name: get CFEngine package | ||
run: cf-remote --version 3.18.x download x86_64 msi | ||
- name: move CFEngine package to current workdir | ||
run: "mv $HOME/.cfengine/cf-remote/packages/*.msi cfengine.msi" | ||
- name: install CFEngine | ||
run: | | ||
Get-Location # pwd | ||
New-Item -Path "c:\" -Name "artifacts" -ItemType Directory | ||
Start-Process msiexec.exe -Wait -ArgumentList '/quiet /qn /i cfengine.msi /L*V c:\tmp.log' | ||
Get-Content c:\tmp.log | Set-Content -Encoding utf8 c:\artifacts\CFEngine-Install.log | ||
file c:\artifacts\CFEngine-Install.log | ||
shell: pwsh | ||
- name: run cf-agent | ||
run: "'/c/Program Files/Cfengine/bin/cf-agent.exe' --version" | ||
# Note that msiexec install CFEngine onto the C: drive (/c/ partition), | ||
# but testall expects it to be on the same partition as where all tests are located (D: drive), | ||
# hence we just copy it over. | ||
- name: copy CFEngine to workdir partition | ||
run: 'cp -a /d/a/core /c/' | ||
- name: prune platform independent tests to make the job more efficient | ||
run: 'Remove-Item -Recurse -Force 00_basics, 01_vars, 02_classes, 10_files, 14_reports, 15_control, 16_cf-serverd, 21_methods, 22_cf-runagent, 26_cf-net, 27_cf-secret, 28_inform_testing' | ||
working-directory: "/c/core/tests/acceptance" | ||
shell: pwsh | ||
# - name: check copied cfengine contents | ||
# run: "ls -l /d/a/Cfengine/bin" | ||
# | ||
- name: run the tests | ||
run: './testall --bindir="/d/a/Cfengine/bin" --extraclasses=EXTRA ./05_processes/01_matching/process_count_found.cf ' | ||
working-directory: "C:\core\tests\acceptance" | ||
env: | ||
# env vars for testall script to properly detect environment | ||
USER: runneradmin | ||
OSTYPE: msys | ||
- name: print test.log | ||
run: 'cat ./tests/acceptance/test.log || true' | ||
working-directory: "C:\core" | ||
if: ${{ always() }} | ||
- name: save test.log in artifacts | ||
run: 'cp ./tests/acceptance/test.log /c/artifacts/test.log || true' | ||
working-directory: "C:\core" | ||
if: ${{ always() }} | ||
# make a tarball because otherwise there will be too many files and github won't save in the artifact | ||
- name: save workdir to artifacts | ||
run: 'tar cfz /c/artifacts/workdir.tar.gz ./tests/acceptance/workdir || true' | ||
working-directory: "C:\core" | ||
if: ${{ always() }} | ||
- name: save artifacts | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: c:\artifacts |