diff --git a/.github/actions/build-and-test-windows/action.ps1 b/.github/actions/build-and-test-windows/action.ps1 new file mode 100644 index 0000000000..2dad33ef7f --- /dev/null +++ b/.github/actions/build-and-test-windows/action.ps1 @@ -0,0 +1,26 @@ +Param( + [Parameter(Mandatory=$true)] + [ValidateSet('c++14', 'c++17', 'c++20')] + [string[]] + $dialect +) + +function TestReturnCode { + if (-not $?) { + throw 'Step Failed' + } +} + +$ErrorActionPreference = "Stop" +Push-location "$PSScriptRoot/../../.." + +# This function is imported from a pre-loaded module +Get-VSDevPrompt + +cmake -S ./ -B ../build -DCMAKE_CXX_COMPILER=cl -DCMAKE_CUDA_COMPILER=nvcc -G Ninja +TestReturnCode + +$ENV:LIBCUDACXX_SITE_CONFIG="$(Get-Location)/../build/test/lit.site.cfg" + +lit -v --no-progress-bar -Dcompute_archs=90 -Dexecutor="NoopExecutor()" -Dstd="$dialect" .upstream-tests/test +TestReturnCode diff --git a/.github/actions/build-and-test-windows/action.yml b/.github/actions/build-and-test-windows/action.yml new file mode 100644 index 0000000000..558e653778 --- /dev/null +++ b/.github/actions/build-and-test-windows/action.yml @@ -0,0 +1,28 @@ +name: "Build libcudacxx on Windows" +description: "Builds wcow images with MSVC and CUDA" + +inputs: + windows_url: + type: string + required: true + description: Windows image to use for build + dialect: + type: string + required: true + description: Dialect to build and test. + +runs: + using: composite + steps: + + - name: "Fetch ${{ inputs.windows_url }}" + id: build + shell: powershell + run: docker pull ${{ inputs.windows_url }} + + - name: "Configure and test" + id: test + shell: powershell + run: | + docker run --mount type=bind,src=$(pwd),dst=C:\libcudacxx ${{ inputs.windows_url }} ` + "C:\libcudacxx\.github\actions\build-and-test-windows\action.ps1 -Dialect ${{ inputs.dialect }}" diff --git a/.github/workflows/test_on_pull_request.yml b/.github/workflows/test_on_pull_request.yml new file mode 100644 index 0000000000..11cf6bd7d3 --- /dev/null +++ b/.github/workflows/test_on_pull_request.yml @@ -0,0 +1,43 @@ +on: + pull_request: + branches: + - main + +permissions: + contents: read + pull-requests: read + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + build-and-test: + name: "Build and test libcudacxx" + runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + version: [2017, 2019, 2022] + stdver: ['c++14', 'c++17', 'c++20'] + exclude: + - version: 2017 + stdver: 'c++20' + - version: 2019 + stdver: 'c++20' + steps: + - name: Checkout ${{ github.repository }} + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Log in to registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: "Build config: VS${{ matrix.version }} + ${{ matrix.stdver }}" + uses: ./.github/actions/build-and-test-windows + with: + windows_url: ghcr.io/${{ github.repository_owner }}/cuda-windows-images:windows-server-cuda-msvc-${{ matrix.version }} + dialect: "${{ matrix.stdver }}" diff --git a/.gitignore b/.gitignore index 4c38aea682..7ec5249d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,43 +1,12 @@ -samples/trie -samples/trie.exe +.cache +.clangd/ .vscode/* -samples/pg996.txt -samples/1342-0.txt -samples/2600-0.txt -samples/2701-0.txt -samples/35-0.txt -samples/84-0.txt -samples/8800.txt -samples/pg1727.txt -samples/pg55.txt -samples/pg6130.txt -samples/log.txt -samples/trie.exp -samples/trie.lib -samples/trie.txt -samples/out.txt -samples/temp.txt -samples/trie.cu.txt -samples/trie_mt.exe -samples/trie.obj -samples/trie_mt.obj -samples/trie_st.exe -samples/trie_st.obj -samples/trial -samples/trie_st -samples/trie_mt -samples/rtc -samples/benchmark *.pyc -build-*/ -build/ -.p4config -compare_git_to_perforce.bash *.log -.clangd/ -.cache -Output/ -compile_commands.json +*.obj *~ *lit_test_times.txt -llvm-project/ \ No newline at end of file +build/ +Output/ +compare_git_to_perforce.bash +compile_commands.json