-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (108 loc) · 3.59 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: main
on:
pull_request:
env:
# libcxx version to match whats already installed
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
LLVM_VERSION: '18.1.3'
CPP2B_LIBCXX_BUILD_ROOT: '/tmp/llvm-project/build'
jobs:
typos-check:
name: Typos Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@cfe759ac8dd421e203cc293a373396fbc6fe0d4b # v1.22.7
build-script-windows:
name: 'build.cmd'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: .\build.cmd
- uses: actions/upload-artifact@v4
with:
name: cpp2b-windows-latest
path: dist/debug/cpp2b.exe
if-no-files-found: error
retention-days: 0
build-self-windows:
name: 'build self (windows)'
needs: build-script-windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cpp2b-windows-latest
- run: .\cpp2b.exe build
- run: Copy-Item .\.cache\cpp2\bin\cpp2b.exe -Destination .\cpp2b-self.exe
- run: .\cpp2b-self.exe build
build-script-linux:
name: 'build.sh'
runs-on: ubuntu-24.04
steps:
- run: sudo apt-get install libclang-dev ninja-build -y
- uses: actions/cache@v4
id: libcxx_with_modules
with:
path: /tmp/llvm-project/build
key: 'libcxx-${{ env.LLVM_VERSION }}'
- name: compiling libcxx ${{ env.LLVM_VERSION }} with modules
if: steps.libcxx_with_modules.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch llvmorg-${{ env.LLVM_VERSION }} https://github.com/llvm/llvm-project.git /tmp/llvm-project
cd /tmp/llvm-project
mkdir build
CC=clang-18 CXX=clang++-18 cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind"
ninja -C build
- uses: actions/checkout@v4
- run: CC=clang-18 ./build.sh
- uses: actions/upload-artifact@v4
with:
name: cpp2b-ubuntu-24.04
path: dist/debug/cpp2b
if-no-files-found: error
retention-days: 0
build-self-linux:
name: 'build self (linux)'
needs: build-script-linux
runs-on: ubuntu-24.04
steps:
- uses: actions/cache/restore@v4
with:
path: /tmp/llvm-project/build
key: 'libcxx-${{ env.LLVM_VERSION }}'
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cpp2b-ubuntu-24.04
- run: chmod +x cpp2b
- run: ./cpp2b build
- run: ./.cache/cpp2/bin/cpp2b build
build-examples:
name: build examples
needs: [build-script-windows, build-script-linux]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
example:
- init
os:
- windows-latest
- ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
id: cpp2b-binary
with:
name: 'cpp2b-${{ matrix.os }}'
- uses: actions/cache/restore@v4
if: "'${{ matrix.os }}' == 'ubuntu-24.04'"
with:
path: /tmp/llvm-project/build
key: 'libcxx-${{ env.LLVM_VERSION }}'
- run: 'mv ${{ steps.cpp2b-binary.outputs.download-path }}/cpp2b ${{ steps.cpp2b-binary.outputs.download-path }}/cpp2b.exe'
if: "'${{ matrix.os }}' == 'ubuntu-24.04'"
- run: '${{ steps.cpp2b-binary.outputs.download-path }}/cpp2b.exe build'
working-directory: "examples/${{ matrix.example }}"