name: PMDK on: [push, pull_request] env: GITHUB_REPO: pmem/pmdk DOCKERHUB_REPO: pmem/pmdk jobs: linux: name: Linux runs-on: ubuntu-latest env: DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }} HOST_WORKDIR: /home/runner/work/pmdk/pmdk WORKDIR: utils/docker PMDK_CC: gcc PMDK_CXX: g++ MAKE_PKG: 0 REMOTE_TESTS: 1 VALGRIND: 1 SRC_CHECKERS: 0 strategy: matrix: CONFIG: ["N=1 OS=ubuntu OS_VER=19.10 FAULT_INJECTION=1 TEST_BUILD=debug", "N=2 OS=ubuntu OS_VER=19.10 FAULT_INJECTION=1 TEST_BUILD=nondebug UBSAN=1", "N=3 OS=ubuntu OS_VER=19.10 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=debug SRC_CHECKERS=1", "N=4 OS=ubuntu OS_VER=19.10 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=nondebug", "N=5 OS=fedora OS_VER=31 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=debug", "N=6 OS=fedora OS_VER=31 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=nondebug AUTO_DOC_UPDATE=1", "N=7 OS=fedora OS_VER=31 MAKE_PKG=1 EXPERIMENTAL=y REMOTE_TESTS=0 VALGRIND=0 PUSH_IMAGE=1", "N=8 OS=ubuntu OS_VER=19.10 MAKE_PKG=1 EXPERIMENTAL=y REMOTE_TESTS=0 VALGRIND=0 NDCTL_ENABLE=n PUSH_IMAGE=1", "N=9 OS=ubuntu OS_VER=19.10 MAKE_PKG=1 EXPERIMENTAL=y REMOTE_TESTS=0 VALGRIND=0 NDCTL_ENABLE=n PMDK_CC=clang PMDK_CXX=clang++", "N=10 OS=ubuntu OS_VER=19.10 COVERAGE=1 FAULT_INJECTION=1 TEST_BUILD=debug"] steps: - name: Clone the git repo uses: actions/checkout@v2 with: fetch-depth: 50 - name: Pull or rebuild the image run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh - name: Run the build run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build-CI.sh - name: Push the image run: cd $WORKDIR && source ./set-vars.sh && ${{ matrix.CONFIG }} /bin/bash -c "if [[ -f ${CI_FILE_PUSH_IMAGE_TO_REPO} ]]; then images/push-image.sh; fi" windows: name: Windows runs-on: windows-latest env: platform: x64 solutionname: PMDK.sln ex_solutionname: Examples.sln msbuild: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin" # Platform Toolset for Visual Studio 2019 platform_toolset: "v142" perl: "C:\\Strawberry\\perl\\bin" strategy: matrix: CONFIG: [Debug, Release] steps: - name: Update Path run: | echo "::add-path::$Env:msbuild" echo "::add-path::$Env:perl" - name: Clone the git repo uses: actions/checkout@v2 - name: Unshallow it run: git fetch --prune --unshallow - name: Various debug checks (cstyle, whitespace etc.) run: | if ("${{ matrix.CONFIG }}" -eq "Release") { Install-Module PsScriptAnalyzer -Force utils/CSTYLE.ps1 if ($LASTEXITCODE -ne 0) { exit 1 } utils/CHECK_WHITESPACE.ps1 if ($LASTEXITCODE -ne 0) { exit 1 } utils/ps_analyze.ps1 if ($LASTEXITCODE -ne 0) { exit 1 } perl utils/sort_solution check if ($LASTEXITCODE -ne 0) { exit 1 } ./utils/check_sdk_version.py -d . if ($LASTEXITCODE -ne 0) { exit 1 } } - name: Build run: | msbuild src\$Env:solutionname -property:Configuration=${{ matrix.CONFIG }},PlatformToolset=$Env:platform_toolset -m -v:m msbuild src\examples\$Env:ex_solutionname -property:Configuration=${{ matrix.CONFIG }},PlatformToolset=$Env:platform_toolset -m -v:m - name: Create ZIP archive run: utils/CREATE-ZIP.ps1 -b ${{ matrix.CONFIG }} - name: Run tests shell: powershell run: | if ($true) { cd src\test echo "`$Env:NON_PMEM_FS_DIR = `"C:\temp`"" >> testconfig.ps1 echo "`$Env:PMEM_FS_DIR = `"C:\temp`"" >> testconfig.ps1 echo "`$Env:PMEM_FS_DIR_FORCE_PMEM = `"1`"" >> testconfig.ps1 echo "`$Env:PMDK_NO_ABORT_MSG = `"1`"" >> testconfig.ps1 echo "`$Env:TM = `"1`"" >> testconfig.ps1 write-output "config = { 'unittest_log_level': 1, 'cacheline_fs_dir': 'C:\\temp', 'force_cacheline': True, 'page_fs_dir': 'C:\\temp', 'force_page': False, 'byte_fs_dir': 'C:\\temp', 'force_byte': True, 'tm': True, 'test_type': 'check', 'granularity': 'all', 'fs_dir_force_pmem': 1, 'keep_going': False, 'timeout': '4m', 'build': 'debug', 'force_enable': None, 'fail_on_skip': False, 'enable_admin_tests': False, }" | out-file "testconfig.py" -encoding utf8 if ("${{ matrix.CONFIG }}" -eq "Debug") { ./RUNTESTS.ps1 -b debug -o 4m if ($?) { python ./RUNTESTS.py -b debug } } if ("${{ matrix.CONFIG }}" -eq "Release") { ./RUNTESTS.ps1 -b nondebug -o 4m if ($?) { python ./RUNTESTS.py -b release } } }