Byte Datentyp #604
Workflow file for this run
This file contains hidden or 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: Cache LLVM | |
| id: cache-llvm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/llvm_build/ | |
| key: ${{ runner.os }}-llvm-build-${{ hashFiles('**/Makefile', '**/cmd/Makefile') }} | |
| restore-keys: | | |
| ${{ runner.os }}-llvm-build- | |
| - name: Setup LLVM | |
| if: 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-14.0.0-${{ runner.os == 'Windows' && 'windows-mingw-12.2.0-ucrt-posix-seh-x86_64' || 'linux-gcc-11.4.0-x86_64' }}.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 External Libs | |
| id: cache-external | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/lib/external/*.a | |
| ${{ github.workspace }}/lib/external/*_build/ | |
| key: ${{ runner.os }}-external-${{ hashFiles('**/lib/external/Makefile', '**/.gitmodules') }} | |
| restore-keys: | | |
| ${{ runner.os }}-external | |
| - name: Run tests | |
| run: | | |
| make -j5 ${{ steps.cache-external.outputs.cache-hit == 'true' && '--old-file=lib/external/*.a' || '' }} test | tee test.log | |
| - name: Upload Coverage Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report-${{ runner.os }} | |
| path: | | |
| tests/coverage.md | |
| test.log | |
| retention-days: 30 |