update homepage url #72
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 | |
on: [push, pull_request] | |
env: | |
BUILD_TYPE: Release | |
LLVM_VERSION: 12.0.0 | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-10.15, windows-2019] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
export LLVM_TARBALL_NAME=clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-$(lsb_release -sr) | |
wget --no-verbose https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/$LLVM_TARBALL_NAME.tar.xz | |
tar -xf $LLVM_TARBALL_NAME.tar.xz | |
export LLVMDIR="$PWD/$LLVM_TARBALL_NAME" | |
fi | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
export LLVM_TARBALL_NAME=clang+llvm-$LLVM_VERSION-x86_64-apple-darwin | |
wget --no-verbose https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/$LLVM_TARBALL_NAME.tar.xz | |
tar -xf $LLVM_TARBALL_NAME.tar.xz | |
export LLVMDIR="$PWD/$LLVM_TARBALL_NAME" | |
fi | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
curl -L "https://ziglang.org/deps/llvm%2bclang%2blld-$LLVM_VERSION-x86_64-windows-msvc-release-mt.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 | |
export LLVMDIR="$(echo "$PWD/llvm+clang+lld-$LLVM_VERSION-x86_64-windows-msvc-release-mt" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/')" | |
fi | |
echo "LLVMDIR=$LLVMDIR" >> $GITHUB_ENV | |
echo "$LLVMDIR/bin" >> $GITHUB_PATH | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure CMake | |
shell: bash | |
working-directory: ${{runner.workspace}}/build | |
run: | | |
export CMAKE_BUILD_PARALLEL_LEVEL="" | |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="$LLVMDIR" | |
- 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 |