]>
Commit | Line | Data |
---|---|---|
cd74e1d9 DG |
1 | name: CI |
2 | on: [push, pull_request] | |
3 | ||
4 | jobs: | |
9580a259 PH |
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: | | |
86550c37 PH |
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" | |
9083fe84 PH |
21 | echo "$(pwd)/llvm/bin" >> $GITHUB_PATH |
22 | echo "WASM_AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV | |
9580a259 PH |
23 | if: matrix.os == 'windows-latest' |
24 | ||
25 | - name: Install llvm-nm (Windows) | |
9580a259 | 26 | run: | |
9ca51871 | 27 | rustup update stable |
9580a259 PH |
28 | rustup default stable |
29 | rustup component add llvm-tools-preview | |
378fd4b2 PH |
30 | if: matrix.os == 'windows-latest' |
31 | ||
32 | - name: Register llvm-nm in environment (Windows) | |
33 | shell: bash | |
34 | run: | | |
5b148b61 | 35 | echo "WASM_NM=$(rustc --print sysroot|sed 's|C:|/c|'|sed 's|\\|/|g')/lib/rustlib/x86_64-pc-windows-msvc/bin/llvm-nm.exe" >> $GITHUB_ENV |
9580a259 PH |
36 | if: matrix.os == 'windows-latest' |
37 | ||
38 | - name: Install clang (MacOS) | |
39 | shell: bash | |
40 | run: | | |
86550c37 PH |
41 | 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 - |
42 | export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-apple-darwin/bin | |
9083fe84 PH |
43 | echo "$CLANG_DIR" >> $GITHUB_PATH |
44 | echo "WASM_CC=$CLANG_DIR/clang" >> $GITHUB_ENV | |
9580a259 PH |
45 | if: matrix.os == 'macos-latest' |
46 | ||
47 | - name: Install clang (Linux) | |
48 | shell: bash | |
49 | run: | | |
86550c37 PH |
50 | 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 - |
51 | export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin | |
9083fe84 PH |
52 | echo "$CLANG_DIR" >> $GITHUB_PATH |
53 | echo "WASM_CC=$CLANG_DIR/clang" >> $GITHUB_ENV | |
9580a259 PH |
54 | if: matrix.os == 'ubuntu-latest' |
55 | ||
56 | - name: Build libc | |
57 | shell: bash | |
58 | run: make -j4 | |
59 | ||
60 | - uses: actions/upload-artifact@v1 | |
61 | with: | |
62 | # Upload the sysroot folder. Give it a name according to the OS it was built for. | |
63 | name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }} | |
64 | path: sysroot | |
65 | ||
2f24a36e DG |
66 | # Disable the headerstest job for now, while WASI transitions from the |
67 | # witx snapshots to wit proposals, and we have a few manual edits to the | |
68 | # generated header to make life easier for folks. | |
9580a259 | 69 | headerstest: |
2f24a36e | 70 | if: ${{ false }} # Disable the headers test for now. |
9580a259 | 71 | name: wasi-headers test |
cd74e1d9 DG |
72 | runs-on: ${{ matrix.os }} |
73 | strategy: | |
74 | matrix: | |
75 | os: [ubuntu-latest, macos-latest, windows-latest] | |
76 | steps: | |
8b3266db | 77 | - uses: actions/checkout@v1 |
cd74e1d9 DG |
78 | with: |
79 | submodules: true | |
80 | - name: Install Rust (rustup) | |
81 | shell: bash | |
82 | run: rustup update stable --no-self-update && rustup default stable | |
83 | if: matrix.os != 'macos-latest' | |
84 | - name: Install Rust (macos) | |
85 | run: | | |
86 | curl https://sh.rustup.rs | sh -s -- -y | |
9083fe84 | 87 | echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
cd74e1d9 DG |
88 | if: matrix.os == 'macos-latest' |
89 | - run: cargo fetch | |
90 | working-directory: tools/wasi-headers | |
91 | - run: cargo build | |
92 | working-directory: tools/wasi-headers | |
93 | - run: cargo test | |
94 | working-directory: tools/wasi-headers | |
95 | ||
96 | rustfmt: | |
97 | name: Rustfmt | |
98 | runs-on: ubuntu-latest | |
99 | steps: | |
8b3266db | 100 | - uses: actions/checkout@v1 |
cd74e1d9 DG |
101 | with: |
102 | submodules: true | |
103 | - name: Install Rust | |
104 | run: rustup update stable && rustup default stable && rustup component add rustfmt | |
105 | - run: cargo fmt -- --check | |
106 | working-directory: tools/wasi-headers |