-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- upgraded to checkout, upload-artifact, deploy-pages, and configure-pages - only publish `RelWithDebInfo` builds in artifact - separated test into a dedicated action - only send discord notification on failure
- Loading branch information
Showing
4 changed files
with
98 additions
and
79 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,76 @@ | ||
name: "Discord Notification" | ||
name: Notify | ||
|
||
on: | ||
pull_request: | ||
types: [ opened ] | ||
issues: | ||
types: [ opened ] | ||
workflow_run: | ||
workflows: ["Build Artifact", "build"] | ||
workflows: ["Build", "Test"] | ||
types: [completed] | ||
branches: ["*"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
|
||
jobs: | ||
on-success: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: CI Build Success Notification | ||
uses: sarisia/actions-status-discord@v1 | ||
with: | ||
nodetail: true | ||
title: "[${{ github.repository }}] ${{ github.actor }} pushed to `${{ github.ref }}`" | ||
description: | | ||
**Commits**: | ||
● ${{ join(github.event.commits.*.message, ' | ||
● ') }} | ||
--- | ||
**Link**: ${{ github.event.compare }} | ||
color: 0x0000ff | ||
username: ${{ github.actor }} on CFB | ||
avatar_url: https://i.imgur.com/O4RKNqj.png | ||
|
||
on-failure: | ||
on_workflow_failure: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- name: CI Build Failure Notification | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
uses: sarisia/actions-status-discord@v1 | ||
- uses: sarisia/actions-status-discord@v1 | ||
with: | ||
nodetail: true | ||
title: "[${{ github.repository }}] ${{ github.actor }} pushed to `${{ github.ref }}`" | ||
title: "⚠️ '${{ github.event.workflow_run.name }}' failed ${{ github.sha }} on ${{ github.ref }} ${{ github.actor }}" | ||
description: | | ||
**Commits**: | ||
● ${{ join(github.event.commits.*.message, ' | ||
● ') }} | ||
Build failure for | ||
● SHA ${{ github.sha }} | ||
● REF ${{ github.ref }} | ||
● ACTOR ${{ github.actor }} | ||
--- | ||
**Link**: ${{ github.event.compare }} | ||
[Link](${{ github.event.workflow_run.html_url }}) | ||
color: 0xff0000 | ||
username: ${{ github.actor }} on CFB | ||
avatar_url: https://i.imgur.com/O4RKNqj.png | ||
|
||
on-pull-requests: | ||
on_pull_requests: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- name: Triggering Pull Request Discord Notification | ||
if: github.event_name == 'pull_request' && github.event.action == 'opened' && github.repository_owner == 'hugsy' | ||
uses: sarisia/actions-status-discord@v1 | ||
- uses: sarisia/actions-status-discord@v1 | ||
with: | ||
nodetail: true | ||
title: ${{ github.actor }} created a new Pull Request (`#${{ github.event.pull_request.number }}`) | ||
title: "🚧 ${{ github.actor }} ${{ github.event.action }} PR `#${{ github.event.pull_request.number }}`" | ||
description: | | ||
**${{ github.event.pull_request.title }}** | ||
${{ github.event.pull_request.body }} | ||
--- | ||
Link: ${{ github.event.pull_request.html_url }} | ||
color: 0xff0000 | ||
[Link](${{ github.event.pull_request.html_url }}) | ||
color: 0x00ff00 | ||
username: ${{ github.actor }} on CFB | ||
avatar_url: https://i.imgur.com/O4RKNqj.png | ||
|
||
on-issues: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'issues' | ||
steps: | ||
- name: Triggering Issue Discord Notification | ||
if: github.event_name == 'issues' && github.event.action == 'opened' && github.repository_owner == 'hugsy' | ||
uses: sarisia/actions-status-discord@v1 | ||
- uses: sarisia/actions-status-discord@v1 | ||
with: | ||
nodetail: true | ||
title: ${{ github.actor }} created a new Issue (`#${{ github.event.issue.number }}`) | ||
title: "❓ ${{ github.actor }} ${{ github.event.action }} Issue `#${{ github.event.issue.number }}`" | ||
description: | | ||
**${{ github.event.issue.title }}** | ||
${{ github.event.issue.body }} | ||
--- | ||
Link: ${{ github.event.issue.html_url }} | ||
color: 0x00ff00 | ||
[Link](${{ github.event.issue.html_url }}) | ||
color: 0x0000ff | ||
username: ${{ github.actor }} on CFB | ||
avatar_url: https://i.imgur.com/O4RKNqj.png |
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,46 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build",] | ||
|
||
jobs: | ||
test: | ||
name: "${{ matrix.platform }}/${{ matrix.configuration }}" | ||
|
||
env: | ||
CMAKE_FLAGS: "-DCFB_BUILD_TOOLS:BOOL=OFF -DCFB_BUILD_GUI:BOOL=OFF -DCFB_BUILD_TESTS:BOOL=ON" | ||
CMAKE_TOOLCHAIN_FILE: "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" | ||
TAG_NAME: "" | ||
NB_CPU: 1 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ['windows-latest'] | ||
platform: ['x64'] # , 'arm64', 'win32' | ||
configuration: ['RelWithDebInfo'] # 'Debug', | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
shell: pwsh | ||
run: | | ||
echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Import-Module .\.github\Invoke-VisualStudio.ps1 | ||
Invoke-VisualStudio2022${{ matrix.platform }} | ||
- name: Build | ||
shell: pwsh | ||
run: | | ||
mkdir build | ||
cmake -S . -B ./build -A ${{ matrix.platform }} ${{ env.CMAKE_FLAGS }} | ||
cmake --build ./build --verbose --parallel ${{ env.NB_CPU }} --config ${{ matrix.configuration }} | ||
- name: Test | ||
shell: pwsh | ||
run: | | ||
ctest --parallel ${{ env.NB_CPU }} --build-config ${{ matrix.configuration }} -T test --test-dir ./build |