Fixed clang error #1220
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-windows: | |
name: ${{matrix.os}}-${{ matrix.sys }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: msys2 {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2019, windows-2022] | |
sys: [mingw64, mingw32, ucrt64, clang64, clang32] | |
steps: | |
- name: Setup MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.sys }} | |
install: base-devel | |
pacboy: toolchain:p | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Compile runtime | |
run: make nujel.exe | |
- name: Test runtime | |
run: make test | |
release-windows: | |
name: release-${{ matrix.sys }}-windows | |
needs: static-checks | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
sys: [mingw32, mingw64, ucrt64, clang64, clang32] | |
steps: | |
- name: Setup MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.sys }} | |
install: base-devel | |
pacboy: toolchain:p | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Compile release | |
run: make release | |
- name: Run Tests | |
run: ./nujel.exe --slow-test tools/tests.nuj | |
- name: Upload release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Nujel-windows-${{ matrix.sys }}-release-${{ github.ref_name }} | |
path: "./nujel.exe" | |
retention-days: 7 | |
build-macos: | |
name: build-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-14, macos-13, macos-12, macos-11] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Compile runtime | |
run: make nujel | |
- name: Test runtime | |
run: make test | |
release-macos: | |
name: ${{ matrix.buildtype }}-macos | |
needs: static-checks | |
strategy: | |
fail-fast: false | |
matrix: | |
buildtype: [release] | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Release | |
run: make ${{ matrix.buildtype }} | |
- name: Test runtime | |
run: ./nujel --slow-test tools/tests.nuj | |
- name: Upload release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Nujel-macos-${{ github.ref_name }}-${{ matrix.buildtype }} | |
path: "./nujel" | |
retention-days: 7 | |
build-linux: | |
name: ${{ matrix.os }}-${{ matrix.cc }}-${{matrix.make}} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04] | |
cc: [clang, gcc] | |
make: [make] | |
include: | |
- os: ubuntu-22.04 | |
cc: gcc | |
make: bmake | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install compiler | |
run: | | |
sudo apt-get -y install ${{ matrix.cc }} ${{ matrix.make }} | |
- name: Compile runtime | |
run: ${{matrix.make}} CC=${{ matrix.cc }} nujel | |
- name: Test runtime | |
run: ${{matrix.make}} CC=${{ matrix.cc }} test | |
build-wasm: | |
name: wasm-clang-make | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install compiler | |
run: | | |
sudo apt-get -y install wasi-libc | |
curl https://wasmtime.dev/install.sh -sSf | sudo bash | |
wget https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.4/wasmtime-v14.0.4-x86_64-linux.tar.xz | |
tar -xvf wasmtime-v14.0.4-x86_64-linux.tar.xz | |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz | |
tar -xvf wasi-sdk-20.0-linux.tar.gz | |
- name: Compile runtime | |
run: | | |
make nujel.wasm WASI_CLANG=./wasi-sdk-20.0/bin/clang WASI_SDK_PATH=./wasi-sdk-20.0/share/wasi-sysroot/ WASI_STRIP=./wasi-sdk-20.0/bin/strip | |
- name: Test runtime | |
run: ./wasmtime-v14.0.4-x86_64-linux/wasmtime --dir=. nujel.wasm tools/tests.nuj | |
build-stdlib: | |
name: Build stdlib from source | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cc: [gcc] | |
make: [make, bmake] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install compiler | |
run: sudo apt-get -y install ${{ matrix.cc }} ${{ matrix.make }} | |
- name: Test runtime | |
run: ${{matrix.make}} CC=${{ matrix.cc }} test.future.slow | |
static-analysis-linux: | |
name: Clang - static analysis | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install compiler | |
run: | | |
sudo apt-get -y install clang clang-tools make | |
- name: Run static analyzer | |
run: scan-build --status-bugs make nujel | |
valgrind-linux: | |
name: Valgrind - memory leak check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install compiler | |
run: | | |
sudo apt-get update && sudo apt-get -y install valgrind | |
- name: Check for leaks | |
run: make valgrind | |
static-checks: | |
name: Static checks | |
needs: [valgrind-linux, static-analysis-linux, build-stdlib, build-linux, build-macos, build-windows, build-wasm] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
release-linux: | |
name: ${{ matrix.buildtype }}-linux | |
runs-on: ubuntu-latest | |
needs: static-checks | |
strategy: | |
fail-fast: false | |
matrix: | |
buildtype: [release, release.musl] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y musl-dev musl-tools | |
- name: Build release | |
run: make ${{ matrix.buildtype }} | |
- name: Test runtime | |
run: ./nujel --slow-test tools/tests.nuj | |
- name: Upload release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Nujel-linux-${{ github.ref_name }}-${{ matrix.buildtype }} | |
path: "./nujel" | |
retention-days: 7 | |
release-wasm: | |
name: release.wasm | |
runs-on: ubuntu-latest | |
needs: static-checks | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install compiler | |
run: | | |
sudo apt-get -y install wasi-libc | |
wget https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.4/wasmtime-v14.0.4-x86_64-linux.tar.xz | |
tar -xvf wasmtime-v14.0.4-x86_64-linux.tar.xz | |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz | |
tar -xvf wasi-sdk-20.0-linux.tar.gz | |
- name: Compile runtime | |
run: make release.wasm WASI_CLANG=./wasi-sdk-20.0/bin/clang WASI_SDK_PATH=./wasi-sdk-20.0/share/wasi-sysroot/ WASI_STRIP=./wasi-sdk-20.0/bin/strip | |
- name: Test runtime | |
run: ./wasmtime-v14.0.4-x86_64-linux/wasmtime --dir=. nujel.wasm --slow-test tools/tests.nuj | |
- name: Upload release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Nujel-wasm-${{ github.ref_name }}-release | |
path: "./nujel.wasm" | |
retention-days: 7 |