Skip to content

Commit

Permalink
Merge pull request #2 from open-vcpkg/dummytest
Browse files Browse the repository at this point in the history
Add a simple smoke test
  • Loading branch information
m-kuhn authored Feb 12, 2024
2 parents 45422b3 + 76ffe60 commit f7a8a6c
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 31 deletions.
43 changes: 18 additions & 25 deletions .github/actions/setup-vcpkg/action.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
name: Setup Vcpkg
description: Install a full vcpkg environment
inputs:

vcpkgVersion:
description: Enter vcpkg version tag or stable or latest
required: false
default: latest
type: string

vcpkgRoot:
description: Enter VCPKGROOT as vcpkg root path
required: false
default: /usr/local/vcpkg
type: string

vcpkgDownload:
description: Enter VCPKGDOWNLOAD as vcpkg download path
required: false
default: /usr/local/vcpkg-downloads
type: string
description: Initialize vcpkg tool, does not checkout the registry
# TODO, set VCPKG_BASE_VERSION based on this
# inputs:
# vcpkg-version:
# description: Enter vcpkg version tag or stable or latest
# required: false
# default: latest
# type: string

runs:
using: composite
steps:
- name: Setup vcpkg
if: runner.os != 'Windows'
shell: bash
run: |
git clone --depth 1 https://github.com/msclock/features.git /tmp/vcpkg
. <(curl https://aka.ms/vcpkg-init.sh -L)
echo "PATH=$VCPKG_ROOT;$PATH" >> $GITHUB_ENV
sudo USERNAME="$USER" VCPKGVERSION="${{ inputs.vcpkgVersion }}" VCPKGROOT="${{ inputs.vcpkgRoot }}" \
VCPKGDOWNLOAD="${{ inputs.vcpkgDownload }}" /tmp/vcpkg/src/vcpkg/install.sh
vcpkg --version
shell: bash
- name: Setup vcpkg
if: runner.os == 'Windows'
shell: powershell
run: |
iex (iwr -useb https://aka.ms/vcpkg-init.ps1)
echo "PATH=$env:VCPKG_ROOT;$env:PATH" >> $env:GITHUB_ENV
6 changes: 0 additions & 6 deletions .github/workflows/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 2

- name: Setup vcpkg
uses: ./.github/actions/setup-vcpkg
with:
vcpkgVersion: latest
vcpkgRoot: /usr/local/vcpkg
vcpkgDownload: /usr/local/vcpkg-downloads

- name: Format vcpkg.json
run: |
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: πŸͺŸ Windows
on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: build (windows)
runs-on: windows-2022
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- triplet: 'x64-windows'

steps:
- name: 🐣 Checkout
uses: actions/checkout@v4

- name: 🐩 Install CMake and Ninja
uses: lukka/get-cmake@latest

- name: 🧽 Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1

- name: πŸ• Checkout vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
ref: 345ac44ab8d6a16239d3af55df9608bf725e7a48 # TODO: can we have a canonical baseline for tests?
path: vcpkg
fetch-depth: 1

- name: 🐾 Bootstrap vcpkg
shell: powershell
run: |
$PKG_SOURCE_USER = $env:GITHUB_REPOSITORY -split '/' | Select-Object -First 1
.\vcpkg\bootstrap-vcpkg.bat
.$(.\vcpkg\vcpkg.exe fetch nuget) sources add -Name ghpkg -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json" -UserName "$PKG_SOURCE_USER" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
.$(.\vcpkg\vcpkg.exe fetch nuget) setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json"
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $env:GITHUB_ENV
echo "PATH=$env:VCPKG_ROOT;$env:PATH" >> $env:GITHUB_ENV
echo "VCPKG_ROOT=$env:VCPKG_ROOT" >> $env:GITHUB_ENV
- name: πŸŒ‹ Build
run: |
.\vcpkg\vcpkg.exe install --overlay-ports="${{ github.workspace }}/ports" --triplet=${{ matrix.triplet }} py-sip
- name: πŸ“‘ Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs-${{ matrix.triplet }}
path: /c/vcpkg/buildtrees/**/*.log

0 comments on commit f7a8a6c

Please sign in to comment.