Skip to content
Open
Show file tree
Hide file tree
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
83 changes: 63 additions & 20 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,83 @@ jobs:
matrix:
python-version: [3.7]

env:
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'
VCPKG_ASSET_SOURCES: "${{ github.workspace }}/vcpkgAssets"
X_VCPKG_ASSET_SOURCES: clear;x-azurl,file:///${{ github.workspace }}/vcpkgAssets,,readwrite
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkgBin,readwrite
VCPKG_BUILD_TREES: "${{ github.workspace }}/vcpkgBuild"
VCPKG_INSTALLED_DIR: "${{ github.workspace }}/vcpkgInstalled"
VCPKG_INSTALL_OPTIONS: "--x-buildtrees-root=${{ github.workspace }}/vcpkgBuild"
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
VCPKG_DEFAULT_HOST_TRIPLET: 'x64-windows'

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are referring to all actions by sha. Is that really necessary ? Why not use a version tag instead ? Wouldn't that be simpler (more readable, easier to maintain, etc.) ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referring to GitHub Actions by SHA is considered a security best practice. See https://docs.github.com/en/actions/reference/security/secure-use?learn=getting_started#using-third-party-actions .

It's not too difficult to maintain if one uses a tool like Dependabot or Renovate[bot] to keep dependencies up to date, including GitHub Actions dependencies.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for readability, I do at least include the version tag in a comment. Hopefully that helps at least a little bit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I noticed. Thanks !
Please go ahead and merge this if you are satisfied with the PR. Many thanks again for all your effort on this ! I wouldn't have been able to pull this off on my own, as I haven't developed on & for Windows in a long time.
Your work will unblock a number of other changes that I was hesitant to add while the Windows build was broken, so I'm thrilled to see this being completed.
Cheers !


- name: Restore vcpkg cache
id: cache-vcpkg-restore
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
"${{ github.workspace }}/vcpkgAssets"
"${{ github.workspace }}/vcpkgBCache"
"${{ github.workspace }}/vcpkgBin"
"${{ github.workspace }}/vcpkgBuild"
key: vcpkgCache-${{ github.repository_owner }}-${{ matrix.os }}-${{ matrix.triplet }}-${{ hashFiles('vcpkg.json') }}

- name: Create directories on cache miss
run: |
mkdir -p "${{ github.workspace }}/vcpkgAssets"
mkdir -p "${{ github.workspace }}/vcpkgBCache"
mkdir -p "${{ github.workspace }}/vcpkgBin"
mkdir -p "${{ github.workspace }}/vcpkgBuild"
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'

- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: microsoft/setup-msbuild@v2

- uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0

- name: Install CMake
uses: lukka/get-cmake@591817e96fcad43505fb4eae36172462abb3a42e # v4.3.3

- name: setup boost prerequisites
uses: lukka/run-vcpkg@v6
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgGitCommitId: '88b1071e39f13b632644d9d953738d345a4ac055'
vcpkgDirectory: '${{ runner.workspace }}/vcpkg'
vcpkgTriplet: x64-windows
vcpkgArguments: >
boost-config
boost-core
boost-function
boost-graph
boost-iterator
boost-lexical-cast
boost-mpl
boost-preprocessor
boost-smart-ptr
boost-static-assert
boost-align
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
binaryCachePath: "${{ github.workspace }}/vcpkgBCache"
runVcpkgInstall: true

- name: List directory contents
run: Get-ChildItem "${{ github.workspace }}" -Recurse -Force -File -Filter 'config.hpp'
shell: pwsh

- name: setup faber
run: |
python -m pip install --upgrade pip
python -m pip install setuptools faber numpy
faber --info=tools cxx

- name: build
shell: cmd
run: |
faber --builddir=build cxx.name=msvc --log=commands --log=output --with-boost-include=${{ runner.workspace }}\vcpkg\installed\x64-windows\include -j4
faber --builddir=build cxx.name=msvc --log=commands --log=output --with-boost-include="${{ github.workspace }}/vcpkgInstalled/x64-windows/include" -j4

- name: test
shell: cmd
run: |
faber --builddir=build cxx.name=msvc --with-boost-include=${{ runner.workspace }}\vcpkg\installed\x64-windows\include -j4 test.report
faber --builddir=build cxx.name=msvc --with-boost-include="${{ github.workspace }}/vcpkgInstalled/x64-windows/include" -j4 test.report

- name: Save vcpkg cache
id: cache-vcpkg-save
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
"${{ github.workspace }}/vcpkgAssets"
"${{ github.workspace }}/vcpkgBCache"
"${{ github.workspace }}/vcpkgBin"
"${{ github.workspace }}/vcpkgBuild"
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
20 changes: 20 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "boost-python",
"version-string": "1.91.0",
"builtin-baseline": "f3e10653cc27d62a37a3763cd84b38bca07c6075",
"dependencies": [
"boost-config",
"boost-core",
"boost-function",
"boost-graph",
"boost-iterator",
"boost-lexical-cast",
"boost-mpl",
"boost-preprocessor",
"boost-smart-ptr",
"boost-static-assert",
"boost-align",
"python3"
]
}
Loading