]>
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] | |
7a21011e | 11 | # oldest and newest supported LLVM version |
12 | clang_version: [10.0.0, 14.0.0] | |
9580a259 PH |
13 | steps: |
14 | - uses: actions/checkout@v1 | |
15 | with: | |
16 | submodules: true | |
17 | ||
61786461 | 18 | - name: Install LLVM tools (Windows) |
9580a259 PH |
19 | shell: bash |
20 | run: | | |
7a21011e | 21 | curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/LLVM-${{ matrix.clang_version }}-win64.exe |
22 | 7z x LLVM-${{ matrix.clang_version }}-win64.exe -y -o"llvm" | |
61786461 | 23 | echo "$(pwd)/llvm/bin" >> $GITHUB_PATH |
9e09e02a | 24 | echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV |
9eb4a995 | 25 | echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV |
a279514a | 26 | echo "NM=$(pwd)/llvm/bin/llvm-nm.exe" >> $GITHUB_ENV |
9580a259 PH |
27 | if: matrix.os == 'windows-latest' |
28 | ||
61786461 | 29 | - name: Override llvm-nm with one from rustup (Windows) |
9580a259 | 30 | run: | |
9ca51871 | 31 | rustup update stable |
9580a259 PH |
32 | rustup default stable |
33 | rustup component add llvm-tools-preview | |
a279514a | 34 | echo "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 |
35 | if: matrix.os == 'windows-latest' |
36 | ||
61786461 | 37 | - name: Install LLVM tools (MacOS) |
9580a259 PH |
38 | shell: bash |
39 | run: | | |
7a21011e | 40 | curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/clang+llvm-${{ matrix.clang_version }}-x86_64-apple-darwin.tar.xz | tar xJf - |
41 | export CLANG_DIR=`pwd`/clang+llvm-${{ matrix.clang_version }}-x86_64-apple-darwin/bin | |
9083fe84 | 42 | echo "$CLANG_DIR" >> $GITHUB_PATH |
9e09e02a | 43 | echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV |
9eb4a995 | 44 | echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV |
a279514a | 45 | echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV |
9580a259 PH |
46 | if: matrix.os == 'macos-latest' |
47 | ||
61786461 | 48 | - name: Install LLVM tools (Linux) |
9580a259 PH |
49 | shell: bash |
50 | run: | | |
7a21011e | 51 | curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/clang+llvm-${{ matrix.clang_version }}-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf - |
52 | export CLANG_DIR=`pwd`/clang+llvm-${{ matrix.clang_version }}-x86_64-linux-gnu-ubuntu-18.04/bin | |
9083fe84 | 53 | echo "$CLANG_DIR" >> $GITHUB_PATH |
9e09e02a | 54 | echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV |
9eb4a995 | 55 | echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV |
a279514a | 56 | echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV |
9580a259 PH |
57 | if: matrix.os == 'ubuntu-latest' |
58 | ||
59 | - name: Build libc | |
60 | shell: bash | |
61 | run: make -j4 | |
62 | ||
63 | - uses: actions/upload-artifact@v1 | |
64 | with: | |
65 | # Upload the sysroot folder. Give it a name according to the OS it was built for. | |
66 | name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }} | |
67 | path: sysroot | |
68 | ||
2f24a36e DG |
69 | # Disable the headerstest job for now, while WASI transitions from the |
70 | # witx snapshots to wit proposals, and we have a few manual edits to the | |
71 | # generated header to make life easier for folks. | |
9580a259 | 72 | headerstest: |
2f24a36e | 73 | if: ${{ false }} # Disable the headers test for now. |
9580a259 | 74 | name: wasi-headers test |
cd74e1d9 DG |
75 | runs-on: ${{ matrix.os }} |
76 | strategy: | |
77 | matrix: | |
78 | os: [ubuntu-latest, macos-latest, windows-latest] | |
79 | steps: | |
8b3266db | 80 | - uses: actions/checkout@v1 |
cd74e1d9 DG |
81 | with: |
82 | submodules: true | |
83 | - name: Install Rust (rustup) | |
84 | shell: bash | |
85 | run: rustup update stable --no-self-update && rustup default stable | |
86 | if: matrix.os != 'macos-latest' | |
87 | - name: Install Rust (macos) | |
88 | run: | | |
89 | curl https://sh.rustup.rs | sh -s -- -y | |
9083fe84 | 90 | echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
cd74e1d9 DG |
91 | if: matrix.os == 'macos-latest' |
92 | - run: cargo fetch | |
93 | working-directory: tools/wasi-headers | |
94 | - run: cargo build | |
95 | working-directory: tools/wasi-headers | |
96 | - run: cargo test | |
97 | working-directory: tools/wasi-headers | |
98 | ||
99 | rustfmt: | |
100 | name: Rustfmt | |
101 | runs-on: ubuntu-latest | |
102 | steps: | |
8b3266db | 103 | - uses: actions/checkout@v1 |
cd74e1d9 DG |
104 | with: |
105 | submodules: true | |
106 | - name: Install Rust | |
107 | run: rustup update stable && rustup default stable && rustup component add rustfmt | |
108 | - run: cargo fmt -- --check | |
109 | working-directory: tools/wasi-headers |