[llvm] trying jvstech/toolchain script , llvm 16 #4
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 llvm-toochain using https://github.com/jvstech/llvm-toolchain | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- jvstech_toolchain | |
jobs: | |
build: | |
name: Build | |
continue-on-error: false | |
strategy: | |
matrix: | |
target: | |
- id: 'linux-amd64' | |
os: 'ubuntu-latest' | |
tar_extra_args: '' | |
# - id: 'linux-amd64-mips' | |
# os: 'ubuntu-latest' | |
# tar_extra_args: '' | |
# target: 'mipsel-unknown-linux-gnu' | |
# - id: 'linux-amd64-aarch64' | |
# os: 'ubuntu-latest' | |
# tar_extra_args: '' | |
# host: 'aarch64-linux-gnu' too old script | |
# - id: 'linux-aarch64' | |
# os: "ubuntu-latest" | |
# os: ['self-hosted', 'linux', 'ARM64'] | |
# - id: 'linux-riscv64' | |
# os: "ubuntu-latest" | |
# os: ['self-hosted', 'linux', 'RISCV64'] | |
## https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ | |
- id: 'darwin-amd64' | |
os: 'macos-14' | |
tar_extra_args: '' | |
# - id: 'windows-amd64' | |
# os: 'windows-2019' | |
# When unpacking an archive on Windows, the symlinks can't be | |
# created unless the target path already exists. This causes | |
# problems when the linked file is ordered after the link | |
# inside the archive. Dereferencing the files when packing them | |
# adds an additional copy per link, but it reliably works and | |
# the additional size is not too large on Windows. | |
# tar_extra_args: '--dereference' | |
# llvm_repo_url: ['https://github.com/llvm/llvm-project.git'] | |
fail-fast: true | |
runs-on: ${{ matrix.target.os }} | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Check out jvstech/llvm-toolchain source code | |
uses: actions/checkout@v4 | |
with: | |
repository: jvstech/llvm-toolchain | |
ref: 14-update-to-llvm-16 | |
path: llvm-toolchain | |
- name: Install `ninja llvm cmake ` on macOS | |
if: startsWith(matrix.target.id, 'darwin-') | |
shell: bash | |
run: | | |
brew install ninja llvm cmake tree | |
clang --version | |
echo "BREW_INSTALL_PREFIX=$(brew --prefix llvm)" >> $GITHUB_ENV | |
echo "${BREW_INSTALL_PREFIX}/bin" | |
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH | |
clang --version | |
echo "llvm" | |
/opt/homebrew/opt/llvm/bin/clang --version | |
- name: Install `ninja` on Ubuntu | |
if: startsWith(matrix.target.id, 'linux-') | |
shell: bash | |
run: | | |
sudo apt install ninja-build build-essential tree clang coreutils gcc-multilib g++-multilib texinfo -y | |
echo "cpu core num is " | |
nproc | |
- name: build | |
shell: bash | |
run: | | |
mkdir -p build | |
tree -L 4 | |
cd llvm-toolchain | |
cmake -P build-llvm-toolchain.cmake | |
tree -L 4 | |
- name: show content info | |
shell: bash | |
run: | | |
tree -L 4 | |
- name: Zip | |
shell: bash | |
run: | | |
mkdir -p dist | |
tree -L 4 | |
tar --directory llvm-toolchain/install --create --xz --verbose ${{ matrix.target.tar_extra_args }} --file dist/llvm-toolchain.tar.xz . | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target.id }}-${{ matrix.target.os }}-${{ matrix.target.target }} | |
path: dist | |
if-no-files-found: error | |
retention-days: 7 |