-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ auto build (no test suites) for msvc/clang-cl with debug/release configuration + mainteinance set to on build success + mainteinance also updates vcpkg.json `version-date`, **not vcpkg registry** + updates README.md with vcpkg version and build status accordingly
- Loading branch information
Showing
7 changed files
with
119 additions
and
17 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#Requires -Version 5 | ||
|
||
# args | ||
param ( | ||
[string]$PathIn | ||
) | ||
|
||
# test-path | ||
if (!(Test-Path "$PathIn/CommonLibSF") -or !(Test-Path "$PathIn/CommonLibSF/vcpkg.json") -or !(Test-Path "$PathIn/README.md")) { | ||
Write-Output "::set-output name=VCPKG_SUCCESS::false" | ||
exit | ||
} | ||
|
||
# commit time | ||
$version = (Get-Date -AsUTC -Format "yyyy-MM-dd") | ||
|
||
# update vcpkg | ||
$vcpkg = [IO.File]::ReadAllText("$PathIn/CommonLibSF/vcpkg.json") | ConvertFrom-Json | ||
$vcpkg.'version-date' = $version | ||
$vcpkg = $vcpkg | ConvertTo-Json -Depth 9 | ForEach-Object { $_ -replace "(?m) (?<=^(?: )*)", " " } | ||
[IO.File]::WriteAllText("$PathIn/CommonLibSF/vcpkg.json", $vcpkg) | ||
|
||
# update readme | ||
$readme = [IO.File]::ReadAllLines("$PathIn/README.md") | ||
$readme = $readme -replace "(?<=label=vcpkg&message=).+?(?=&color)", $version | ||
[IO.File]::WriteAllLines("$PathIn/README.md", $readme) | ||
|
||
# status | ||
Write-Output "::set-output name=VCPKG_SUCCESS::true" | ||
Write-Output "::set-output name=VCPKG_VERSION::$version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Main CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/main_ci.yml' | ||
- 'CommonLibSF/**' | ||
pull_request: | ||
branches: [ main, feature/* ] | ||
workflow_dispatch: | ||
|
||
env: | ||
VCPKG_COMMIT_ID: 095ee8757ec933b22d445738d2dbb1ce89bb8021 | ||
|
||
jobs: | ||
build-and-test-vcpkg: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build-type: | ||
- debug | ||
- release | ||
compiler: | ||
- msvc | ||
- clang-cl | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup MSVC Environment | ||
uses: ilammy/[email protected] | ||
|
||
- name: Setup vcpkg | ||
uses: lukka/run-vcpkg@v11 | ||
with: | ||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} | ||
|
||
- name: Setup cmake | ||
uses: jwlawson/[email protected] | ||
with: | ||
cmake-version: '3.26' | ||
|
||
- name: Generate | ||
run: cmake -B "${{ github.workspace }}/build" -S "${{ github.workspace }}/CommonLibSF" --preset=build-debug-${{ matrix.compiler }} | ||
|
||
- name: Build | ||
run: cmake --build "${{ github.workspace }}/build" --config ${{ matrix.build-type }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,46 @@ | ||
on: [push] | ||
name: "Maintainance" | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Main CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
maintainance: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- shell: pwsh | ||
run: "& ${{ github.workspace }}/CommonLibSF/cmake/make-directives.ps1 ${{ github.workspace }}/CommonLibSF" | ||
- name: Update Starfield.h | ||
shell: pwsh | ||
run: "& ${{ github.workspace }}/.github/make-directives.ps1 ${{ github.workspace }}/CommonLibSF" | ||
|
||
- uses: DoozyX/[email protected] | ||
- name: Enforce style formatting | ||
uses: DoozyX/[email protected] | ||
with: | ||
source: '.' | ||
exclude: './docs' | ||
extensions: 'c,cc,cpp,cxx,h,hpp,hxx,inl,inc,ixx' | ||
extensions: 'c,cc,cpp,cppm,cxx,h,hpp,hxx,inl,inc,ixx,mxx' | ||
clangFormatVersion: 16 | ||
inplace: True | ||
|
||
- name: Update vcpkg version-date | ||
id: versioning | ||
shell: pwsh | ||
run: "& ${{ github.workspace }}/.github/update-registry.ps1 ${{ github.workspace }}" | ||
|
||
- name: Check for success | ||
run: exit 1 | ||
if: ${{ steps.versioning.outputs.VCPKG_SUCCESS == 'false' }} | ||
|
||
- uses: EndBug/add-and-commit@v9 | ||
- name: Check for commit | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: maintenance | ||
message: 'chore: maintenance' | ||
message: 'ci: maintenance `${{ steps.versioning.outputs.VCPKG_VERSION }}`' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters