Skip to content

Commit

Permalink
GHA: add initial workflow for building on Windows
Browse files Browse the repository at this point in the history
Introduce a Windows build using GHA. This builds with both SPM and
CMake.
  • Loading branch information
compnerd committed Dec 4, 2024
1 parent 8bc4631 commit a63afe3
Showing 1 changed file with 168 additions and 0 deletions.
168 changes: 168 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Windows Build

on:
pull_request:
branches:
- main

jobs:
windows-spm:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
include:
- branch: swift-6.0-release
tag: 6.0-RELEASE

name: SPM ${{ matrix.tag }}

steps:
- uses: compnerd/gha-setup-swift@main
with:
tag: ${{ matrix.tag }}
branch: ${{ matrix.branch }}

- uses: actions/checkout@v4

- name: Build
run: swift build -v

- name: Test
run: swift test -v

windows-cmake:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
include:
- branch: swift-6.0-release
tag: 6.0-RELEASE

name: CMake ${{ matrix.tag }}

steps:
- uses: compnerd/gha-setup-vsdevenv@main

- uses: compnerd/gha-setup-swift@main
with:
tag: ${{ matrix.tag }}
branch: ${{ matrix.branch }}

- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/SourceCache/swift-docc

- uses: actions/checkout@v4
with:
repository: apple/swift-argument-parser
ref: 0fbc8848e389af3bb55c182bc19ca9d5dc2f255b # 1.4.0
path: ${{ github.workspace }}/SourceCache/swift-argument-parser

- uses: actions/checkout@v4
with:
repository: apple/swift-crypto
ref: 06dc63c6d8da54ee11ceb268cde1fa68161afc96 # 3.9.1
path: ${{ github.workspace }}/SourceCache/swift-crypto

- uses: actions/checkout@v4
with:
repository: apple/swift-markdown
ref: d21714073e0d16ba78eebdf36724863afc36871d # main
path: ${{ github.workspace }}/SourceCache/swift-markdown

- uses: actions/checkout@v4
with:
repository: apple/swift-lmdb
ref: c42582487fe84f72a4d417dd2d8493757bd4d072 # main
path: ${{ github.workspace }}/SourceCache/swift-lmdb

- uses: actions/checkout@v4
with:
repository: apple/swift-docc-symbolkit
ref: 96bce1cfad4f4d7e265c1eb46729ebf8a7695f4b # main
path: ${{ github.workspace }}/SourceCache/swift-docc-symbolkit

- uses: actions/checkout@v4
with:
repository: swiftlang/swift-cmark
ref: 2c47322cb32cbed555f13bf5cbfaa488cc30a785 # gfm
path: ${{ github.workspace }}/SourceCache/swift-cmark

- name: Build swift-argument-parser
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-argument-parser `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-argument-parser `
-D BUILD_EXAMPLES=NO
cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser
- name: Build swift-crypto
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-crypto `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-crypto
cmake --build ${{ github.workspace }}/BinaryCache/swift-crypto
- name: Build cmark-gfm
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-cmark `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-cmark `
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=YES
cmake --build ${{ github.workspace }}/BinaryCache/swift-cmark
- name: Build swift-markdown
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-markdown `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-markdown `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D cmark-gfm_DIR=${{ github.workspace }}/BinaryCache/swift-cmark/cmake/modules
cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown
- name: Build LMDB
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-lmdb `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-lmdb
cmake --build ${{ github.workspace }}/BinaryCache/swift-lmdb
- name: Build SymbolKit
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-docc-symbolkit `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-docc-symbolkit
cmake --build ${{ github.workspace }}/BinaryCache/swift-docc-symbolkit
- name: Build DocC
run: |
cmake -B ${{ github.workspace }}/BinaryCache/swift-docc `
-D BUILD_SHARED_LIBS=YES `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-docc `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules `
-D SwiftMarkdown_DIR=${{ github.workspace }}/BinaryCache/swift-markdown/cmake/modules `
-D LMDB_DIR=${{ github.workspace }}/BinaryCache/swift-lmdb/cmake/modules `
-D SymbolKit_DIR=${{ github.workspace }}/BinaryCache/swift-symbolkit/cmake/modules `
-D cmark-gfm_DIR=${{ github.workspace }}/BinaryCache/cmark-gfm/cmake/modules
cmake --build ${{ github.workspace }}/BinaryCache/swift-docc

0 comments on commit a63afe3

Please sign in to comment.