CI: Update #53
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: Windows | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: 4a600e9fea71bd7872080cbb716797e04d30e6d3 | |
- name: NASM | |
uses: ilammy/setup-nasm@v1 | |
- name: MinGW | |
uses: egor-tensin/setup-mingw@v2 | |
with: | |
platform: x86 | |
version: 12.2.0 | |
- name: CoD4x | |
run: | | |
cd ../ | |
curl -o CoD4x_Server-20.1.zip https://codeload.github.com/callofduty4x/CoD4x_Server/zip/refs/tags/20.1 | |
7z x CoD4x_Server-20.1.zip | |
cp -r CGSC CoD4x_Server-20.1/src/CGSC | |
- name: Build | |
working-directory: ../CoD4x_Server-20.1/src/CGSC | |
run: | | |
mkdir build && cd build | |
cmake .. --preset windows -DBUILD_TESTING=True -DCOD4X=True | |
cmake --build . | |
- name: Copy | |
working-directory: ../CoD4x_Server-20.1/src/CGSC | |
run: | | |
cp -r build ../../../CGSC | |
- name: Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifact | |
path: build | |
tests: | |
runs-on: windows-latest | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: OpenCppCoverage | |
shell: bash | |
run: | | |
choco install -y opencppcoverage | |
echo "C:\Program Files\OpenCppCoverage" >> $GITHUB_PATH | |
- name: Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifact | |
path: build | |
- name: Artifact Setup | |
run: | | |
mkdir -p ../CoD4x_Server-20.1/src/CGSC | |
cp -r build ../CoD4x_Server-20.1/src/CGSC | |
- name: Tests | |
run: | | |
opencppcoverage --quiet --export_type=cobertura:opencppcoverageCoverage.xml --working_dir build --sources src -- build/CGSC.Tests.exe | |
- name: CodeCov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./opencppcoverageCoverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
verbose: true |