Duden/Uri #478
Workflow file for this run
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: Build DDP and run tests | |
on: | |
push: | |
branches: [ "master", "dev" ] | |
pull_request: | |
branches: [ "master", "dev" ] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
env: | |
DDPPATH: ${{ github.workspace }}/build/DDP/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup and Cache Go | |
uses: magnetikonline/action-golang-cache@v5 | |
with: | |
go-version-file: go.mod | |
cache-key-suffix: kompilierer | |
- name: Setup LLVM | |
if: runner.os == 'Linux' | |
run: sudo apt install llvm-12 | |
- name: Cache LLVM | |
if: runner.os == 'Windows' | |
id: cache-llvm | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/llvm_build/ | |
key: ${{ runner.os }}-llvm-build-${{ hashFiles('**/llvm_build/**') }} | |
restore-keys: | | |
${{ runner.os }}-llvm-build- | |
- name: Download Prebuilt LLVM | |
if: runner.os == 'Windows' && steps.cache-llvm.outputs.cache-hit != 'true' | |
run: | | |
curl -L -o ./llvm_build.tar.gz https://github.com/DDP-Projekt/Kompilierer/releases/download/llvm-binaries/llvm_build-mingw-12.2.0-x86_64-ucrt-posix-seh.tar.gz | |
mkdir -p ./llvm_build/ | |
tar -xzf ./llvm_build.tar.gz -C ./ --force-local | |
rm ./llvm_build.tar.gz | |
- name: Get german locale | |
run: sudo locale-gen de_DE.UTF-8 | |
if: runner.os == 'Linux' | |
- name: Set Env | |
if: runner.os == 'Windows' | |
run: | | |
echo "CGO_CPPFLAGS=$('${{ github.workspace }}/llvm_build/bin/llvm-config' --cppflags)" >> $GITHUB_ENV | |
echo "CGO_LDFLAGS=$('${{ github.workspace}}/llvm_build/bin/llvm-config' --ldflags --libs --system-libs all | tr '\r\n' ' ')" >> $GITHUB_ENV | |
echo "CGO_CXXFLAGS=-std=c++14" >> $GITHUB_ENV | |
- name: Cache pcre2 | |
if: runner.os == 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ github.workspace }}/lib/external/pcre2_build/ | |
${{ github.workspace }}/lib/external/libpcre2-8.a | |
key: ${{ runner.os }}-pcre2-${{ hashFiles('**/lib/external/pcre2_build/**', '**/lib/external/libpcre2-8.a') }} | |
restore-keys: | | |
${{ runner.os }}-pcre2- | |
- name: Build | |
run: make -j4 | |
- name: Run tests | |
run: make test | |
- name: Upload Coverage Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-${{ runner.os }} | |
path: tests/coverage.md | |
retention-days: 30 | |
- name: Build debug | |
run: make debug -j4 | |
- name: Run memory tests | |
run: make test-memory |