Skip to content

Commit

Permalink
fix: manually extract llvm release to get more output
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Jan 21, 2021
1 parent 6081592 commit 36654be
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 89 deletions.
19 changes: 15 additions & 4 deletions .github/actions/install-llvm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1189,20 +1189,31 @@ async function execute(cmd) {
core.addPath(`${llvmPath}/bin`)
} else if(isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
core.info(`Downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("succesfully downloaded llvm release, extracting...")
core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = path.resolve("llvm");
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
const llvmPath = await tc.extract7z(downloadLocation, null, _7zPath)
const args = [
"-bsp1", // output log info
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if(exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}

core.info("succesfully extracted llvm release")
core.info("Succesfully extracted LLVM release")
core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch(error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();
Expand Down
19 changes: 15 additions & 4 deletions .github/actions/install-llvm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,31 @@ export async function execute(cmd) {
core.addPath(`${llvmPath}/bin`)
} else if(isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
core.info(`Downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("succesfully downloaded llvm release, extracting...")
core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = path.resolve("llvm");
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
const llvmPath = await tc.extract7z(downloadLocation, null, _7zPath)
const args = [
"-bsp1", // output log info
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if(exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}

core.info("succesfully extracted llvm release")
core.info("Succesfully extracted LLVM release")
core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch(error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();
162 changes: 81 additions & 81 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ env:

jobs:

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install Rust (stable)
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true

- name: Install LLVM
uses: ./.github/actions/install-llvm

- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
# check:
# name: Check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: true
#
# - name: Install Rust (stable)
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
#
# - name: Install LLVM
# uses: ./.github/actions/install-llvm
#
# - name: Cargo check
# uses: actions-rs/cargo@v1
# with:
# command: check

test:
name: Test
runs-on: ${{ matrix.config.os }}
needs: check
# needs: check
strategy:
fail-fast: false
matrix:
config:
- { os: "ubuntu-latest"}
# - { os: "ubuntu-latest"}
- { os: "windows-latest"}
- { os: "macOS-latest"}
# - { os: "macOS-latest"}
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -78,60 +78,60 @@ jobs:
with:
command: test
args: -- --nocapture

style:
name: Check Style
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: clippy, rustfmt

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Install LLVM
uses: ./.github/actions/install-llvm

- name: Run cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

tarpaulin:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rustfmt

- name: Install LLVM
uses: ./.github/actions/install-llvm

- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1

- uses: codecov/codecov-action@v1
with:
file: ${{ steps.coverage.outputs.report }}
name: ${{ matrix.os }}
#
# style:
# name: Check Style
# runs-on: ubuntu-latest
# needs: check
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: true
#
# - name: Install stable toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# components: clippy, rustfmt
#
# - name: Run cargo fmt
# uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check
#
# - name: Install LLVM
# uses: ./.github/actions/install-llvm
#
# - name: Run cargo clippy
# uses: actions-rs/clippy-check@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# args: --all-features
#
# tarpaulin:
# runs-on: ubuntu-latest
# needs: check
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: true
#
# - name: Install toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# components: rustfmt
#
# - name: Install LLVM
# uses: ./.github/actions/install-llvm
#
# - name: Run cargo-tarpaulin
# uses: actions-rs/tarpaulin@v0.1
#
# - uses: codecov/codecov-action@v1
# with:
# file: ${{ steps.coverage.outputs.report }}
# name: ${{ matrix.os }}

0 comments on commit 36654be

Please sign in to comment.