]> git.proxmox.com Git - wasi-libc.git/blob - .github/workflows/main.yml
CI: use llvm 10.0.0 release (#194)
[wasi-libc.git] / .github / workflows / main.yml
1 name: CI
2 on: [push, pull_request]
3
4 jobs:
5 buildlibc:
6 name: Build libc
7 runs-on: ${{ matrix.os }}
8 strategy:
9 matrix:
10 os: [ubuntu-latest, macos-latest, windows-latest]
11 steps:
12 - uses: actions/checkout@v1
13 with:
14 submodules: true
15
16 - name: Install clang (Windows)
17 shell: bash
18 run: |
19 curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe
20 7z x LLVM-10.0.0-win64.exe -y -o"llvm"
21 echo "::add-path::$(pwd)/llvm/bin"
22 echo "::set-env name=WASM_AR::$(pwd)/llvm/bin/llvm-ar.exe"
23 if: matrix.os == 'windows-latest'
24
25 - name: Install llvm-nm (Windows)
26 shell: bash
27 run: |
28 rustup update stable
29 rustup default stable
30 rustup component add llvm-tools-preview
31 echo "::set-env name=WASM_NM::$(rustc --print sysroot|sed 's|C:|/c|'|sed 's|\\|/|g')/lib/rustlib/x86_64-pc-windows-msvc/bin/llvm-nm.exe"
32 if: matrix.os == 'windows-latest'
33
34 - name: Install clang (MacOS)
35 shell: bash
36 run: |
37 curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
38 export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-apple-darwin/bin
39 echo "::add-path::$CLANG_DIR"
40 echo "::set-env name=WASM_CC::$CLANG_DIR/clang"
41 if: matrix.os == 'macos-latest'
42
43 - name: Install clang (Linux)
44 shell: bash
45 run: |
46 curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf -
47 export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
48 echo "::add-path::$CLANG_DIR"
49 echo "::set-env name=WASM_CC::$CLANG_DIR/clang"
50 if: matrix.os == 'ubuntu-latest'
51
52 - name: Build libc
53 shell: bash
54 run: make -j4
55
56 - uses: actions/upload-artifact@v1
57 with:
58 # Upload the sysroot folder. Give it a name according to the OS it was built for.
59 name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }}
60 path: sysroot
61
62 headerstest:
63 name: wasi-headers test
64 runs-on: ${{ matrix.os }}
65 strategy:
66 matrix:
67 os: [ubuntu-latest, macos-latest, windows-latest]
68 steps:
69 - uses: actions/checkout@v1
70 with:
71 submodules: true
72 - name: Install Rust (rustup)
73 shell: bash
74 run: rustup update stable --no-self-update && rustup default stable
75 if: matrix.os != 'macos-latest'
76 - name: Install Rust (macos)
77 run: |
78 curl https://sh.rustup.rs | sh -s -- -y
79 echo "##[add-path]$HOME/.cargo/bin"
80 if: matrix.os == 'macos-latest'
81 - run: cargo fetch
82 working-directory: tools/wasi-headers
83 - run: cargo build
84 working-directory: tools/wasi-headers
85 - run: cargo test
86 working-directory: tools/wasi-headers
87
88 rustfmt:
89 name: Rustfmt
90 runs-on: ubuntu-latest
91 steps:
92 - uses: actions/checkout@v1
93 with:
94 submodules: true
95 - name: Install Rust
96 run: rustup update stable && rustup default stable && rustup component add rustfmt
97 - run: cargo fmt -- --check
98 working-directory: tools/wasi-headers