C-import: warn about unknown C types instead of crashing #104
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 | |
| on: [ push, pull_request ] | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ windows-latest, ubuntu-latest, macos-latest ] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.9 | |
| - name: Download LLVM (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 20 all | |
| echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH | |
| - name: Download LLVM (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install llvm@20 | |
| echo LLVMDIR=$(brew --prefix llvm@20) >> $GITHUB_ENV | |
| - name: Download LLVM (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: bash | |
| run: | | |
| curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/clang+llvm-20.1.6-x86_64-pc-windows-msvc.tar.xz" --output llvm.tar.xz && 7z x llvm.tar.xz && 7z x llvm.tar | |
| # The sed below converts the path to a Windows-style path | |
| echo LLVMDIR="$(echo "$PWD/clang+llvm-20.1.6-x86_64-pc-windows-msvc" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/')" >> $GITHUB_ENV | |
| - name: Create Build Environment | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: Configure CMake | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="$LLVMDIR" -DCMAKE_UNITY_BUILD=OFF | |
| - name: install DIA SDK # Workaround for https://github.com/llvm/llvm-project/issues/86250 | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| set -x | |
| mkdir -p "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional" || true | |
| cp -rv "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/DIA SDK" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK" | |
| - name: Build | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: cmake --build . --config $BUILD_TYPE | |
| - name: Test | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: | | |
| pip install lit psutil | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get update | |
| sudo apt-get install libsdl2-dev libglfw3-dev | |
| fi | |
| if [ "$RUNNER_OS" == "macOS" ]; then | |
| brew install sdl2 glfw3 | |
| fi | |
| # Tests depending on SDL2 or GLFW are disabled on Windows CI. | |
| cmake --build . --config $BUILD_TYPE --target check | |
| deploy-website: | |
| if: github.repository == 'cx-language/cx' && github.ref == 'refs/heads/main' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Deploy website | |
| run: | | |
| wget --no-verbose https://github.com/jgm/pandoc/releases/download/2.13/pandoc-2.13-1-amd64.deb | |
| sudo dpkg -i pandoc-2.13-1-amd64.deb | |
| ( | |
| cd docs || exit 1 | |
| ./build-website.sh | |
| ) | |
| git clone https://github.com/cx-language/cx-language.github.io.git | |
| cd cx-language.github.io || exit 1 | |
| CX_VERSION=$GITHUB_SHA | |
| echo "$CX_VERSION" > server/.cx-version | |
| cp -a ../docs/build/. ./ | |
| git add . | |
| PREVIOUS_COMMIT_AUTHOR=$(git log -1 --pretty=format:%an) | |
| if [ "$PREVIOUS_COMMIT_AUTHOR" = "C* CI" ]; then | |
| AMEND=--amend | |
| fi | |
| git config user.email "" | |
| git config user.name "C* CI" | |
| git commit --message "Update documentation and C* version to $CX_VERSION" $AMEND | |
| git remote set-url origin "https://${{ secrets.CI_TOKEN }}@github.com/cx-language/cx-language.github.io.git" > /dev/null 2>&1 | |
| git push --quiet --force-with-lease |