-
Notifications
You must be signed in to change notification settings - Fork 65
137 lines (121 loc) · 5.17 KB
/
ci.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [ "main" ]
pull_request:
concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
cmake:
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
# Set up a matrix to run the following 6 configurations:
# 1. <Windows, Debug, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Debug, latest GCC compiler toolchain in the container, default generator>
# 4. <Linux, Release, latest GCC compiler toolchain in the container, default generator>
# 5. <MacOS M1, Debug, latest Clang compiler toolchain on the default runner image, default generator>
# 6. <MacOS M1, Release, latest Clang compiler toolchain on the default runner image, default generator>
# 7. <MacOS x64, Debug, latest Clang compiler toolchain on the default runner image, default generator>
# 8. <MacOS x64, Release, latest Clang compiler toolchain on the default runner image, default generator>
matrix:
os: [windows-latest, ubuntu-latest, macos-latest, macos-13]
build_type: [Debug, Release]
toolchain: [gcc, clang, msvc]
include:
- os: macos-latest
toolchain: clang
c_compiler: clang
cpp_compiler: clang++
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
container: null
- os: macos-13
toolchain: clang
c_compiler: clang
cpp_compiler: clang++
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
container: null
- os: windows-latest
toolchain: msvc
c_compiler: cl
cpp_compiler: cl
container: null
- os: ubuntu-latest
toolchain: gcc
c_compiler: gcc
cpp_compiler: g++
# The manylinux container is to ensure ABI compatibility with glibc 2.28.
# This way, the continuous delivery process casts a wide net across many linux distros.
container: dockcross/manylinux_2_28-x64:latest
exclude:
- os: macos-latest
toolchain: msvc
- os: macos-latest
toolchain: gcc
- os: macos-13
toolchain: msvc
- os: macos-13
toolchain: gcc
- os: ubuntu-latest
toolchain: msvc
- os: ubuntu-latest
toolchain: clang
- os: windows-latest
toolchain: clang
- os: windows-latest
toolchain: gcc
name: CMake-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v4
- name: Set up dependencies on linux
if: matrix.container == 'dockcross/manylinux_2_28-x64:latest'
run: >
dnf install -y mesa-libGL-devel libxcb libxcb-devel libX11-xcb libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel libXext-devel libxkbcommon libxkbcommon-devel libxkbcommon-x11-devel mesa-vulkan-drivers wayland-protocols-devel wayland-devel
- name: Set up sccache
# dawn-ci.cmake documents why sccache is not used in other platforms.
if: matrix.os == 'ubuntu-latest'
uses: mozilla-actions/[email protected]
- name: Configure CMake
run: >
cmake
-S .
-B out/${{ matrix.build_type }}
-C .github/workflows/dawn-ci.cmake
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build out/${{ matrix.build_type }} --config ${{ matrix.build_type }}
- name: Package
run: |
cmake --install out/${{ matrix.build_type }} --config ${{ matrix.build_type }} --prefix Dawn-${{ github.sha }}-${{ matrix.os }}-${{ matrix.build_type }}
cmake -E tar cvzf Dawn-${{ github.sha }}-${{ matrix.os }}-${{ matrix.build_type }}.tar.gz Dawn-${{ github.sha }}-${{ matrix.os }}-${{ matrix.build_type }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Dawn-${{ github.sha }}-${{ matrix.os }}-${{ matrix.build_type }}
path: Dawn-${{ github.sha }}-${{ matrix.os }}-${{ matrix.build_type }}.tar.gz
golang:
name: Go Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...