fix(workflows): Fix release and test workflows #8
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
name: Test | |
on: [push] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Choco packages | |
uses: actions/cache@v3 | |
with: | |
path: ~\AppData\Local\Temp\chocolatey | |
key: ${{ runner.os }}-choco-${{ hashFiles('**/*.yml') }} | |
restore-keys: | | |
${{ runner.os }}-choco- | |
- name: Install dependencies | |
run: | | |
choco install llvm | |
choco install make | |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' | |
- name: Configure | |
run: | | |
$env:CC="clang" | |
$env:CXX="clang++" | |
mkdir build | |
cd build | |
cmake -G "Unix Makefiles" .. | |
- name: Build | |
run: | | |
cd build | |
make | |
- name: Test | |
run: | | |
cd build | |
./tests.exe | |
- name: Upload build artifacts | |
if: success() && contains(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: ./build/ | |
- name: Trigger Release Workflow | |
if: success() && contains(github.ref, 'refs/tags/') | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
event-type: trigger-release |