]> git.proxmox.com Git - wasi-libc.git/blob - .github/workflows/main.yml
37ed35e8152a7b6258d9f1c2f7baea04fe85f2ca
[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 # oldest and newest supported LLVM version
12 clang_version: [10.0.0, 14.0.0]
13 steps:
14 - uses: actions/checkout@v1
15 with:
16 submodules: true
17
18 - name: Install LLVM tools (Windows)
19 shell: bash
20 run: |
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"
23 echo "$(pwd)/llvm/bin" >> $GITHUB_PATH
24 echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV
25 echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV
26 echo "NM=$(pwd)/llvm/bin/llvm-nm.exe" >> $GITHUB_ENV
27 if: matrix.os == 'windows-latest'
28
29 - name: Override llvm-nm with one from rustup (Windows)
30 run: |
31 rustup update stable
32 rustup default stable
33 rustup component add llvm-tools-preview
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
35 if: matrix.os == 'windows-latest'
36
37 - name: Install LLVM tools (MacOS)
38 shell: bash
39 run: |
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
42 echo "$CLANG_DIR" >> $GITHUB_PATH
43 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
44 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
45 echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
46 if: matrix.os == 'macos-latest'
47
48 - name: Install LLVM tools (Linux)
49 shell: bash
50 run: |
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
53 echo "$CLANG_DIR" >> $GITHUB_PATH
54 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
55 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
56 echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
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
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.
72 headerstest:
73 if: ${{ false }} # Disable the headers test for now.
74 name: wasi-headers test
75 runs-on: ${{ matrix.os }}
76 strategy:
77 matrix:
78 os: [ubuntu-latest, macos-latest, windows-latest]
79 steps:
80 - uses: actions/checkout@v1
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
90 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
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:
103 - uses: actions/checkout@v1
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