Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Github Actions workflows #8

Closed
wants to merge 35 commits into from
Closed
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e81c37c
Create go.yml workflow
austinEng Oct 30, 2023
d4f291a
Create cmake.yml workflow
austinEng Oct 30, 2023
130fbfc
Update cmake.yml to fetch test deps and shallow clone
austinEng Oct 30, 2023
df504c9
Update cmake.yml: install ubuntu build dependences
austinEng Oct 30, 2023
2565385
Update cmake.yml: fix missing quote
austinEng Oct 30, 2023
e697e63
Update cmake.yml: fix another missing quote
austinEng Oct 30, 2023
41e67b7
Update cmake.yml: use Ninja generator
austinEng Oct 30, 2023
96049dd
Update cmake.yml: setup visual studio environment
austinEng Oct 30, 2023
49f02ae
Update cmake.yml: fix "matrix.os"
austinEng Oct 30, 2023
1a606fd
Update cmake.yml: use cmd.exe to set visual studio vars
austinEng Oct 30, 2023
fa912ec
Update cmake.yml: Set up Visual Studio environment v2
austinEng Oct 30, 2023
a1d9fbe
Update cmake.yml: add sccache
austinEng Oct 30, 2023
299e858
Update cmake.yml: add build of dawn.node
austinEng Oct 30, 2023
0535ccd
Update cmake.yml: delete dawn.node build
austinEng Oct 30, 2023
225c640
Update cmake.yml: ubuntu add libgl-dev
austinEng Oct 30, 2023
7c8d632
Update cmake.yml: ubuntu add libx11-xcb-dev
austinEng Oct 30, 2023
65aeaa3
Remove python version from build matrix
austinEng Oct 31, 2023
376a8c6
Remove GCC build for now; add Debug builds
austinEng Oct 31, 2023
1a90e50
Exclude Windows MSVC debug builds
austinEng Oct 31, 2023
fcc5c3c
Run workflows on main branch
austinEng Nov 1, 2023
9b31e5c
Add GN build
austinEng Nov 1, 2023
91b31d1
Remove gclient git cache
austinEng Nov 2, 2023
4396819
update go workflow comment
austinEng Nov 7, 2023
a329d58
update comments
austinEng Nov 7, 2023
48d6926
add upload/download of artifacts
austinEng Nov 7, 2023
ccc74d5
continue-on-error download-artifact
austinEng Nov 7, 2023
39c8841
update download step
austinEng Nov 7, 2023
49e93a5
update
austinEng Nov 7, 2023
9558018
update
austinEng Nov 7, 2023
a4471cf
update
austinEng Nov 7, 2023
bf67403
update cmake build out dir
austinEng Nov 7, 2023
e411f40
warn on missing artifacts
austinEng Nov 7, 2023
f80f996
update artifact download
austinEng Nov 7, 2023
70e9f3d
delete artifact upload/download; it is not faster
austinEng Nov 7, 2023
aefd0f4
unify under ci.yml
austinEng Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
gn:
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

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

name: GN ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- name: Install Ubuntu build dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libgl-dev libx11-xcb-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev

- name: Install depot_tools
uses: newkdev/[email protected]

- uses: actions/checkout@v3

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=out/build" >> "$GITHUB_OUTPUT"

- name: Set up checkout
run: |
cp ./scripts/standalone.gclient .gclient

- name: gclient sync --no-history --shallow
run: gclient sync --no-history --shallow
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0

- name: Set up sccache
uses: mozilla-actions/[email protected]

- name: Generate build files
shell: bash
run: |
mkdir -p ${{ steps.strings.outputs.build-output-dir }}
cat << EOF >> ${{ steps.strings.outputs.build-output-dir }}/args.gn
cc_wrapper="sccache"
is_debug=false
is_component_build=true
is_clang=true
EOF
gn gen ${{ steps.strings.outputs.build-output-dir }}

env:
SCCACHE_GHA_ENABLED: "true"
DEPOT_TOOLS_WIN_TOOLCHAIN: 0

- name: Build
run: autoninja -C ${{ steps.strings.outputs.build-output-dir }}
env:
SCCACHE_GHA_ENABLED: "true"
DEPOT_TOOLS_WIN_TOOLCHAIN: 0

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

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Debug, Release]
c_compiler: [clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: clang
- os: windows-latest
c_compiler: cl
build_type: Debug
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
c_compiler: cl

name: CMake ${{ matrix.os }} ${{ matrix.build_type }} (${{ matrix.c_compiler }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/out/build" >> "$GITHUB_OUTPUT"

- name: Install Ubuntu build dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libgl-dev libx11-xcb-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Fetch dependencies
run: python ./tools/fetch_dawn_dependencies.py --use-test-deps --shallow

- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Set up Visual Studio environment
if: matrix.os == 'windows-latest'
uses: seanmiddleditch/gha-setup-vsdevenv@master

- name: Set up sccache
uses: mozilla-actions/[email protected]

- name: Configure CMake
run: >
cmake -G Ninja -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-S ${{ github.workspace }}
env:
SCCACHE_GHA_ENABLED: "true"

- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
env:
SCCACHE_GHA_ENABLED: "true"

golang:
name: Go Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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 ./...
Loading