code: ported fixes and enhancements from original repo #44
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: tests | |
on: | |
push: | |
tags-ignore: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
branches: | |
- master | |
- review/** | |
paths: | |
- 'include/**' | |
- 'CMakeLists.txt' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'include/**' | |
- 'CMakeLists.txt' | |
jobs: | |
prep: | |
name: Notify about testing | |
runs-on: ubuntu-latest | |
steps: | |
- uses: inlife/actiord-action@v1 | |
with: | |
url: ${{ secrets.ACTIORD_URL }} | |
discord_token: ${{ secrets.DISCORD_TOKEN }} | |
discord_channel: ${{ secrets.DISCORD_CHANNEL }} | |
icon: https://avatars1.githubusercontent.com/u/26773913?s=200&v=4 | |
state: started | |
build-win: | |
name: Test Windows | |
runs-on: windows-latest | |
needs: [prep] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Run cmake generator | |
run: cmake -B build -DENET_TEST=1 | |
- name: Run Windows build | |
run: cmake --build build | |
- name: Run unit tests | |
run: cd build ; .\Debug\enet_test.exe | |
- name: Run unit tests with extra peers | |
run: cd build ; .\Debug\enet_test_extra_peers.exe | |
build-lin: | |
name: Test Linux | |
runs-on: ubuntu-latest | |
needs: [prep] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Run cmake generator | |
run: cmake -B build -DENET_TEST=1 | |
- name: Run build on Linux | |
run: cmake --build build | |
- name: Test build on Linux | |
run: build/enet_test | |
- name: Test build on Linux with extra peers | |
run: build/enet_test_extra_peers | |
build-mac: | |
name: Test macOS | |
runs-on: macOS-latest | |
needs: [prep] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Run cmake generator | |
run: cmake -B build -DENET_TEST=1 | |
- name: Run build on macOS | |
run: cmake --build build | |
- name: Test build on macOS | |
run: build/enet_test | |
- name: Test build on macOS with extra peers | |
run: build/enet_test_extra_peers | |
done: | |
name: Notify about status | |
runs-on: ubuntu-latest | |
needs: [build-mac, build-lin, build-win] | |
if: "always()" | |
steps: | |
- uses: inlife/actiord-action@v1 | |
if: ${{ contains(needs.build-mac.result, 'success') && contains(needs.build-lin.result, 'success') && contains(needs.build-win.result, 'success') }} | |
with: | |
url: ${{ secrets.ACTIORD_URL }} | |
icon: https://avatars1.githubusercontent.com/u/26773913?s=200&v=4 | |
state: succeeded | |
- uses: inlife/actiord-action@v1 | |
if: ${{ !(contains(needs.build-mac.result, 'success') && contains(needs.build-lin.result, 'success') && contains(needs.build-win.result, 'success')) }} | |
with: | |
url: ${{ secrets.ACTIORD_URL }} | |
discord_token: ${{ secrets.DISCORD_TOKEN }} | |
discord_channel: ${{ secrets.DISCORD_CHANNEL }} | |
icon: https://avatars1.githubusercontent.com/u/26773913?s=200&v=4 | |
state: failed |