Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use custom prebuild llvm distribution on ubuntu #260

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/actions/install-llvm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,14 @@ async function execute(cmd) {
(async () => {
try {
if(isLinux) {
await exec.exec("sudo apt install llvm-8 llvm-8-* liblld-8*");
let llvmCachedPath = tc.find("llvm", "8.0.1", "linux");
if(!llvmCachedPath) {
llvmCachedPath = await tc.downloadTool("https://github.com/mun-lang/build-support/releases/download/llvm-8.0.1/llvm-8.0.1-ubuntu-12.04-bionic.tar.xz")
.then(downloadPath => tc.extractTar(downloadPath, null, "xJ"))
.then(extractPath => tc.cacheDir(extractPath, "llvm", "8.0.1", "linux"));
}
core.addPath(`${llvmCachedPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmCachedPath}/bin`)
} else if(isMacOS) {
await exec.exec("brew install llvm@8")
let llvmPath = await execute("brew --prefix llvm@8");
Expand Down
9 changes: 8 additions & 1 deletion .github/actions/install-llvm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ export async function execute(cmd) {
(async () => {
try {
if(isLinux) {
await exec.exec("sudo apt install llvm-8 llvm-8-* liblld-8*");
let llvmCachedPath = tc.find("llvm", "8.0.1", "linux");
if(!llvmCachedPath) {
llvmCachedPath = await tc.downloadTool("https://github.com/mun-lang/build-support/releases/download/llvm-8.0.1/llvm-8.0.1-ubuntu-12.04-bionic.tar.xz")
.then(downloadPath => tc.extractTar(downloadPath, null, "xJ"))
.then(extractPath => tc.cacheDir(extractPath, "llvm", "8.0.1", "linux"));
}
core.addPath(`${llvmCachedPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmCachedPath}/bin`)
} else if(isMacOS) {
await exec.exec("brew install llvm@8")
let llvmPath = await execute("brew --prefix llvm@8");
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

check:
name: Check
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -38,9 +38,9 @@ jobs:
fail-fast: false
matrix:
config:
- { os: "ubuntu-latest", toolchain: "stable"}
- { os: "ubuntu-latest", toolchain: "beta"}
- { os: "ubuntu-latest", toolchain: "nightly"}
- { os: "ubuntu-20.04", toolchain: "stable"}
- { os: "ubuntu-20.04", toolchain: "beta"}
- { os: "ubuntu-20.04", toolchain: "nightly"}
- { os: "windows-2016", toolchain: "stable"}
- { os: "macOS-latest", toolchain: "stable"}
steps:
Expand All @@ -60,22 +60,22 @@ jobs:
uses: ./.github/actions/install-llvm

- name: Cargo build
if: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.toolchain == 'stable' }}
if: ${{ matrix.config.os == 'ubuntu-20.04' && matrix.config.toolchain == 'stable' }}
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.config.toolchain == 'nightly' }}
with:
command: build

- name: Install mdbook
if: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.toolchain == 'stable' }}
if: ${{ matrix.config.os == 'ubuntu-20.04' && matrix.config.toolchain == 'stable' }}
uses: actions-rs/[email protected]
with:
crate: mdbook
version: latest
use-tool-cache: true

- name: mdbook test
if: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.toolchain == 'stable' }}
if: ${{ matrix.config.os == 'ubuntu-20.04' && matrix.config.toolchain == 'stable' }}
run: mdbook test book -L target/debug/deps

- name: Cargo test
Expand All @@ -87,7 +87,7 @@ jobs:

style:
name: Check Style
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: check
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
args: --all-features

tarpaulin:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: check
steps:
- uses: actions/checkout@v2
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: release
on:
push:
branches:
- master
- release/*
# on:
# push:
# branches:
# - master
# - release/*
on: [pull_request, push]

env:
RUSTFLAGS: -Dwarnings
Expand All @@ -18,7 +19,7 @@ jobs:
matrix:
config:
- {
os: "ubuntu-latest",
os: "ubuntu-20.04",
dir: linux64,
artifacts: "mun libmun_runtime.so"
}
Expand Down