Skip to content

trigger CI

trigger CI #3609

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build:
name: ${{matrix.config.name}} Build
strategy:
fail-fast: false
matrix:
config:
- os: "windows-2019"
cxx-compiler: cl
c-compiler: cl
compiler-version: default
build-type: Release
nopch: 0
name: Windows CL
- os: "ubuntu-latest"
cxx-compiler: g++
c-compiler: gcc
compiler-version: 11
build-type: RelWithDebInfo
nopch: 0
name: Linux GCC
- os: "ubuntu-latest"
cxx-compiler: clang++
c-compiler: clang
compiler-version: 14
build-type: RelWithDebInfo
nopch: 0
name: Linux Clang
- os: "ubuntu-latest"
cxx-compiler: clang++
c-compiler: clang
compiler-version: 14
build-type: Release
nopch: 1
name: Linux Clang noPCH
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: seanmiddleditch/gha-setup-vsdevenv@v4
- name: Cache curl
uses: actions/cache@v3
with:
path: lib/curl-8.2.1
key: ${{ runner.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-curl-8.2.1-2
- name: Cache antlr
uses: actions/cache@v3
with:
path: lib/antlr
key: ${{ runner.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-antlr-4.13.1
- name: Cache boost
uses: actions/cache@v3
with:
path: lib/boost_1_83_0
key: ${{ runner.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-boost-1.83.0-2
- name: Cache cppdap
uses: actions/cache@v3
with:
path: lib/cppdap-2a4c7cf
key: ${{ runner.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-cppdap-2a4c7cf
- name: Install Compiler and Dependencies
if: matrix.config.os == 'ubuntu-latest'
shell: pwsh
run: |
sudo apt-get update
$compiler = "${{ matrix.config.cxx-compiler }}"
$version = "${{ matrix.config.compiler-version }}"
if ($version -ne 'default') {
sudo apt-get install "$compiler-$version" -y
echo "$compiler-$version --version"
}
sudo apt-get install libmysqlclient-dev -y
sudo apt-get install kwstyle -y
sudo apt-get install uuid-dev -y
$ninja_version = "1.9.0"
$cmake_version = "3.16.2"
$cmake_archive = "cmake-$cmake_version-Linux-x86_64"
wget -q "https://github.com/ninja-build/ninja/releases/download/v$ninja_version/ninja-linux.zip"
unzip -q ninja-linux.zip -d bin-build
wget -q "https://github.com/Kitware/CMake/releases/download/v$cmake_version/$cmake_archive.tar.gz"
tar -xf "$cmake_archive.tar.gz"
chmod +x bin-build/ninja
chmod +x "$cmake_archive/bin/cmake"
echo "$Env:GITHUB_WORKSPACE/bin-build" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$Env:GITHUB_WORKSPACE/$cmake_archive/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Set CXX and CC
shell: pwsh
run: |
$cxx_compiler = '${{ matrix.config.cxx-compiler }}'
$c_compiler = '${{ matrix.config.c-compiler }}'
$version = '${{ matrix.config.compiler-version }}'
if ($version -ne 'default') {
$cxx_compiler = "$cxx_compiler-$version"
$c_compiler = "$c_compiler-$version"
}
echo "CXX=$cxx_compiler" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CC=$c_compiler" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Windows Path Workaround
if: matrix.config.os == 'windows-latest'
shell: cmd
run: |
rmdir /s /q C:\Strawberry
exit /b 0
- name: Register problem matcher
run: echo "::add-matcher::.github/problem-matchers/${{ matrix.config.c-compiler }}.json"
- name: Config
run: |
cd bin-build
cmake .. -G Ninja -DNO_PCH=${{ matrix.config.nopch }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }}
- name: Build
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} -- -j 2
- name: Start MySQL
if: matrix.config.os == 'ubuntu-latest'
shell: pwsh
run: |
sudo /etc/init.d/mysql start
mysql -e "CREATE DATABASE IF NOT EXISTS poltest;" -uroot -proot
echo "POLCORE_TESTSQL=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Test (EScript)
if: matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target test_escript
- name: Test (Shard Fixtures)
if: matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_fixture
- name: Test (UnitTests)
if: matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target unittest_pol
- name: Test (Shard)
if: matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_only
#env:
#POLCORE_TEST_FILTER: testitems
- name: Test (Ecompile Watch)
if: matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target test_ecompile_watch
#env:
#POLCORE_TEST_FILTER: testitems
- name: Upload coretest folder
if: matrix.config.nopch == 0 && always()
uses: actions/upload-artifact@v3
with:
name: Testdir-${{ runner.os }}-${{ matrix.config.cxx-compiler }}
path: bin-build/coretest/
- name: Create Artefact
if: matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target package
cd ../bin
mkdir release
mv *.zip release
- name: Create Artefact (dbg)
if: matrix.config.os == 'ubuntu-latest' && matrix.config.nopch == 0
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} --target create_dbg_zip
cd ../bin
mv *.zip release
- name: Upload Artefact
if: matrix.config.nopch == 0
uses: actions/upload-artifact@v3
with:
name: Nightly-${{ runner.os }}-${{ matrix.config.cxx-compiler }}
path: bin/release
release:
needs: build
runs-on: "ubuntu-latest"
if: github.ref == 'refs/heads/master'
steps:
- name: Download artefacts
uses: actions/download-artifact@v3
with:
name: Nightly-Linux-g++
path: Nightly-Linux-g++
- name: Download artefacts
uses: actions/download-artifact@v3
with:
name: Nightly-Linux-clang++
path: Nightly-Linux-clang++
- name: Download artefacts
uses: actions/download-artifact@v3
with:
name: Nightly-Windows-cl
path: Nightly-Windows-cl
- name: Create Release zip
run: |
zip -j Nightly-Windows.zip Nightly-Windows-cl/*
zip -j Nightly-Linux-gcc.zip Nightly-Linux-g++/*
zip -j Nightly-Linux-clang.zip Nightly-Linux-clang++/*
- name: Create Release
uses: "turleypol/release_action_dist@master"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "NightlyRelease"
reference_release_tag: "v100.1.0"
prerelease: true
title: "Nightly Release"
files: |
Nightly-Windows.zip
Nightly-Linux-gcc.zip
Nightly-Linux-clang.zip
notify_on_failure:
needs: build
runs-on: "ubuntu-latest"
if: failure()
steps:
- name: Discord notification failure
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: failure
job: Building
notify_on_success:
needs: build
runs-on: "ubuntu-latest"
if: success()
steps:
- name: Discord notification success
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: success
job: Building
notify_on_cancel:
needs: build
runs-on: "ubuntu-latest"
if: cancelled()
steps:
- name: Discord notification cancelled
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: cancelled
job: Building