From e81c37c4498d7e49d6775028f869d0dbe5a674b3 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 10:30:28 -0700 Subject: [PATCH 01/35] Create go.yml workflow --- .github/workflows/go.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000000..80e3e676d1e --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,28 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "workflows" ] + pull_request: + branches: [ "workflows" ] + +jobs: + + build: + 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 ./... From d4f291a1dcebc9acc09616d96bbfef6afb222082 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:02:57 -0700 Subject: [PATCH 02/35] Create cmake.yml workflow --- .github/workflows/cmake.yml | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000000..bc43be16201 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,84 @@ +name: CMake build + +on: + push: + branches: [ "workflows" ] + pull_request: + branches: [ "workflows" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + 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 3 configurations: + # 1. + # 2. + # 3. + # 4. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + build_type: [Release] + c_compiler: [gcc, clang, cl] + python-version: ["3.11"] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + - os: macos-latest + c_compiler: clang + cpp_compiler: clang++ + exclude: + - os: windows-latest + c_compiler: gcc + - os: windows-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: cl + - os: macos-latest + c_compiler: gcc + - os: macos-latest + c_compiler: cl + + 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 }}/build" >> "$GITHUB_OUTPUT" + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Fetch dependencies + run: python ./tools/fetch_dawn_dependencies.py + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -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 }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} From 130fbfc2bfa8f126de4725adf50821413e57ec72 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:10:31 -0700 Subject: [PATCH 03/35] Update cmake.yml to fetch test deps and shallow clone --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bc43be16201..0b7f1547c76 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -67,7 +67,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Fetch dependencies - run: python ./tools/fetch_dawn_dependencies.py + run: python ./tools/fetch_dawn_dependencies.py --use-test-deps --shallow - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From df504c9dd5356b1939e1751d794bebc3a71da78d Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:16:09 -0700 Subject: [PATCH 04/35] Update cmake.yml: install ubuntu build dependences --- .github/workflows/cmake.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 0b7f1547c76..15a5830f9bc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -59,7 +59,13 @@ jobs: id: strings shell: bash run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT + + - name: Install Ubuntu build dependencies + if: matrix.os == 'ubuntu-latest + run: | + sudo apt update + sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 25653854b15b483b4aaaed179d5e42414fc1ff41 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:17:10 -0700 Subject: [PATCH 05/35] Update cmake.yml: fix missing quote --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 15a5830f9bc..e004042ff9e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -62,7 +62,7 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT - name: Install Ubuntu build dependencies - if: matrix.os == 'ubuntu-latest + if: matrix.os == 'ubuntu-latest' run: | sudo apt update sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev From e697e6316394f0591b5dba736d5e926d07c107d4 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:20:07 -0700 Subject: [PATCH 06/35] Update cmake.yml: fix another missing quote --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e004042ff9e..f8960d48a8e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -59,7 +59,7 @@ jobs: id: strings shell: bash run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' From 41e67b7e48c99191d93fb4fe632cb8571cb3c3a7 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:46:02 -0700 Subject: [PATCH 07/35] Update cmake.yml: use Ninja generator --- .github/workflows/cmake.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f8960d48a8e..32ce0503bfc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -75,11 +75,14 @@ jobs: - 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: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} + 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 }} From 96049dd11bcac838161199f6f7fdf7b4674dc4c2 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 11:59:01 -0700 Subject: [PATCH 08/35] Update cmake.yml: setup visual studio environment --- .github/workflows/cmake.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 32ce0503bfc..948f7225085 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -78,6 +78,11 @@ jobs: - name: Set up Ninja uses: seanmiddleditch/gha-setup-ninja@master + - name: Set up Visual Studio x64 environment + if: matrix.is == 'windows-latest' + run: | + call "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type From 49f02aec2975858e0ac49bc1bdbc66cd36ba8ecc Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 12:01:28 -0700 Subject: [PATCH 09/35] Update cmake.yml: fix "matrix.os" --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 948f7225085..d300cd23438 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -79,7 +79,7 @@ jobs: uses: seanmiddleditch/gha-setup-ninja@master - name: Set up Visual Studio x64 environment - if: matrix.is == 'windows-latest' + if: matrix.os == 'windows-latest' run: | call "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 From 1a606fdf0b6f07f1562e7f310428e6851176f0e6 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 12:07:44 -0700 Subject: [PATCH 10/35] Update cmake.yml: use cmd.exe to set visual studio vars --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d300cd23438..dbfdfa612cd 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -80,6 +80,7 @@ jobs: - name: Set up Visual Studio x64 environment if: matrix.os == 'windows-latest' + shell: cmd run: | call "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 From fa912ec80c8fbe9ca4e854ec62ae2f6c0a669507 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 12:22:54 -0700 Subject: [PATCH 11/35] Update cmake.yml: Set up Visual Studio environment v2 --- .github/workflows/cmake.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index dbfdfa612cd..f62bd984ee0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -78,11 +78,9 @@ jobs: - name: Set up Ninja uses: seanmiddleditch/gha-setup-ninja@master - - name: Set up Visual Studio x64 environment + - name: Set up Visual Studio environment if: matrix.os == 'windows-latest' - shell: cmd - run: | - call "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + uses: seanmiddleditch/gha-setup-vsdevenv@master - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From a1d9fbe305ac368b706108f82d3500a4897aec45 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 12:46:33 -0700 Subject: [PATCH 12/35] Update cmake.yml: add sccache --- .github/workflows/cmake.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f62bd984ee0..9e7ed98fbfd 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -82,6 +82,9 @@ jobs: if: matrix.os == 'windows-latest' uses: seanmiddleditch/gha-setup-vsdevenv@master + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type @@ -90,8 +93,14 @@ jobs: -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 # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + env: + SCCACHE_GHA_ENABLED: "true" From 299e8587eb301d352e70580197c3dc5cd1a67c30 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 13:50:55 -0700 Subject: [PATCH 13/35] Update cmake.yml: add build of dawn.node --- .github/workflows/cmake.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9e7ed98fbfd..564a31f9c4f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -60,6 +60,7 @@ jobs: shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + echo "build-node-output-dir=${{ github.workspace }}/build-node" >> "$GITHUB_OUTPUT" - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' @@ -104,3 +105,25 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} env: SCCACHE_GHA_ENABLED: "true" + + - name: Configure CMake for dawn.node + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -G Ninja -B ${{ steps.strings.outputs.build-node-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 + -DDAWN_BUILD_NODE_BINDINGS=1 + -DDAWN_ENABLE_PIC=1 + -S ${{ github.workspace }} + env: + SCCACHE_GHA_ENABLED: "true" + + - name: Build dawn.node + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-node-output-dir }} --config ${{ matrix.build_type }} dawn.node + env: + SCCACHE_GHA_ENABLED: "true" From 0535ccd194f083b8de2f8a5d5dedcb75a1d41252 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 14:05:28 -0700 Subject: [PATCH 14/35] Update cmake.yml: delete dawn.node build required deps not in fetch_dawn_dependencies.py yet --- .github/workflows/cmake.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 564a31f9c4f..9e7ed98fbfd 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -60,7 +60,6 @@ jobs: shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - echo "build-node-output-dir=${{ github.workspace }}/build-node" >> "$GITHUB_OUTPUT" - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' @@ -105,25 +104,3 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} env: SCCACHE_GHA_ENABLED: "true" - - - name: Configure CMake for dawn.node - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: > - cmake -G Ninja -B ${{ steps.strings.outputs.build-node-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 - -DDAWN_BUILD_NODE_BINDINGS=1 - -DDAWN_ENABLE_PIC=1 - -S ${{ github.workspace }} - env: - SCCACHE_GHA_ENABLED: "true" - - - name: Build dawn.node - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-node-output-dir }} --config ${{ matrix.build_type }} dawn.node - env: - SCCACHE_GHA_ENABLED: "true" From 225c640cc6bd219173965050ccd4a0b3f339d4ef Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 14:37:52 -0700 Subject: [PATCH 15/35] Update cmake.yml: ubuntu add libgl-dev --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9e7ed98fbfd..cbd61519f3f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,7 +65,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt update - sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev + sudo apt install libgl-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 7c8d632e67b481a1c7e1da64627b219bdbdc447e Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 30 Oct 2023 14:49:14 -0700 Subject: [PATCH 16/35] Update cmake.yml: ubuntu add libx11-xcb-dev --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index cbd61519f3f..012b717e8cc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,7 +65,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt update - sudo apt install libgl-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev + 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 ${{ matrix.python-version }} uses: actions/setup-python@v4 From 65aeaa3c71b1b3cece27d3ccce5ac61f11a724bf Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 31 Oct 2023 13:41:29 -0700 Subject: [PATCH 17/35] Remove python version from build matrix Change-Id: I7072b648f6e567c1f83291b30a2284045837b298 --- .github/workflows/cmake.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 012b717e8cc..5a1b14819ec 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,4 +1,4 @@ -name: CMake build +name: CMake on: push: @@ -25,7 +25,6 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] build_type: [Release] c_compiler: [gcc, clang, cl] - python-version: ["3.11"] include: - os: windows-latest c_compiler: cl @@ -67,10 +66,10 @@ jobs: 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 ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: 3.11 - name: Fetch dependencies run: python ./tools/fetch_dawn_dependencies.py --use-test-deps --shallow @@ -82,7 +81,7 @@ jobs: if: matrix.os == 'windows-latest' uses: seanmiddleditch/gha-setup-vsdevenv@master - - name: Setup sccache + - name: Set up sccache uses: mozilla-actions/sccache-action@v0.0.3 - name: Configure CMake From 376a8c64f578a1e30d12b9bc2dfa695af65a4497 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 31 Oct 2023 13:44:01 -0700 Subject: [PATCH 18/35] Remove GCC build for now; add Debug builds Change-Id: I25612d668bd40ad1cbc68388eadfee8dc0ec99c4 --- .github/workflows/cmake.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5a1b14819ec..8a879a05b58 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -15,23 +15,19 @@ jobs: fail-fast: false # Set up a matrix to run the following 3 configurations: - # 1. - # 2. - # 3. - # 4. + # 1. + # 2. + # 3. # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: os: [ubuntu-latest, windows-latest, macos-latest] - build_type: [Release] - c_compiler: [gcc, clang, cl] + build_type: [Debug, Release] + c_compiler: [clang, cl] include: - os: windows-latest c_compiler: cl cpp_compiler: cl - - os: ubuntu-latest - c_compiler: gcc - cpp_compiler: g++ - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ @@ -39,14 +35,10 @@ jobs: c_compiler: clang cpp_compiler: clang++ exclude: - - os: windows-latest - c_compiler: gcc - os: windows-latest c_compiler: clang - os: ubuntu-latest c_compiler: cl - - os: macos-latest - c_compiler: gcc - os: macos-latest c_compiler: cl From 1a90e50de320c6c510a439930db38e92ce1310f1 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 31 Oct 2023 14:48:38 -0700 Subject: [PATCH 19/35] Exclude Windows MSVC debug builds Experiencing PDB file lock issues https://github.com/google/dawn/actions/runs/6712262986/job/18241441160 Change-Id: Ifee1a8654d96933430f1b98a45b3f7e6d798b602 --- .github/workflows/cmake.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8a879a05b58..212e8e44ac0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -37,6 +37,9 @@ jobs: 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 From fcc5c3c09d96a03a8561d984bebd745dd02dcd29 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 1 Nov 2023 14:47:43 -0700 Subject: [PATCH 20/35] Run workflows on main branch Change-Id: Ibe1b9a0788e10561f25f85b70552c122681d78a1 --- .github/workflows/cmake.yml | 4 ++-- .github/workflows/go.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 212e8e44ac0..cec318887e2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,9 +2,9 @@ name: CMake on: push: - branches: [ "workflows" ] + branches: [ "main" ] pull_request: - branches: [ "workflows" ] + branches: [ "main" ] jobs: build: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 80e3e676d1e..bb098260576 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,9 +5,9 @@ name: Go on: push: - branches: [ "workflows" ] + branches: [ "main" ] pull_request: - branches: [ "workflows" ] + branches: [ "main" ] jobs: From 9b31e5c65ccfcb369075275f46faa9c337cac496 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 1 Nov 2023 15:54:49 -0700 Subject: [PATCH 21/35] Add GN build Change-Id: Ibb0c352d3b8d6a9a0b9d468e51cac286e6863788 --- .github/workflows/cmake.yml | 5 ++ .github/workflows/gn.yml | 93 +++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 .github/workflows/gn.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index cec318887e2..63d86acb633 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,3 +1,4 @@ +# Workflow to build Dawn using CMake name: CMake on: @@ -6,6 +7,10 @@ on: pull_request: branches: [ "main" ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml new file mode 100644 index 00000000000..c0b91aafa1c --- /dev/null +++ b/.github/workflows/gn.yml @@ -0,0 +1,93 @@ +# Workflow to build Dawn using GN +name: GN + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + + 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] + + steps: + - 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 "gclient-cache-dir=${RUNNER_TEMP}/.gclient_cache" >> "$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: Install depot_tools + uses: newkdev/setup-depot-tools@v1.0.1 + + - uses: actions/checkout@v3 + + - name: Set up checkout + run: | + cp ./scripts/standalone.gclient .gclient + mkdir -p ${{ steps.strings.outputs.gclient-cache-dir }} + + - name: gclient restore cache + id: gclient-restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.strings.outputs.gclient-cache-dir }} + key: ${{ runner.os }}-${{ hashFiles('DEPS') }} + restore-keys: ${{ runner.os }}- + + - name: gclient sync --no-history --shallow + run: gclient sync --no-history --shallow + env: + GIT_CACHE_PATH: ${{ steps.strings.outputs.gclient-cache-dir }} + DEPOT_TOOLS_WIN_TOOLCHAIN: 0 + + - name: gclient save cache + id: gclient-save + uses: actions/cache/save@v3 + if: steps.gclient-save.outputs.cache-hit != 'true' + with: + path: ${{ steps.strings.outputs.gclient-cache-dir }} + key: ${{ steps.gclient-restore.outputs.cache-primary-key }} + + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.3 + + - name: Generate build files + shell: bash + run: | + mkdir -p out/build + touch out/build/args.gn + echo "cc_wrapper=\"sccache\"" >> out/build/args.gn + echo "is_debug=true" >> out/build/args.gn + echo "is_component_build=true" >> out/build/args.gn + echo "is_clang=true" >> out/build/args.gn + gn gen out/build + + env: + SCCACHE_GHA_ENABLED: "true" + DEPOT_TOOLS_WIN_TOOLCHAIN: 0 + + - name: Build + run: autoninja -C out/build + env: + SCCACHE_GHA_ENABLED: "true" + DEPOT_TOOLS_WIN_TOOLCHAIN: 0 From 91b31d1aa15f2098757cac573c44995b3a52603e Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 1 Nov 2023 21:04:14 -0700 Subject: [PATCH 22/35] Remove gclient git cache It's too large and the compile cache is more important Change-Id: I8af91b885a39c72fcb0e5d352e06405d175888f3 --- .github/workflows/gn.yml | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index c0b91aafa1c..cc0fbf1c8e6 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -23,13 +23,6 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - 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 "gclient-cache-dir=${RUNNER_TEMP}/.gclient_cache" >> "$GITHUB_OUTPUT" - - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' run: | @@ -44,30 +37,12 @@ jobs: - name: Set up checkout run: | cp ./scripts/standalone.gclient .gclient - mkdir -p ${{ steps.strings.outputs.gclient-cache-dir }} - - - name: gclient restore cache - id: gclient-restore - uses: actions/cache/restore@v3 - with: - path: ${{ steps.strings.outputs.gclient-cache-dir }} - key: ${{ runner.os }}-${{ hashFiles('DEPS') }} - restore-keys: ${{ runner.os }}- - name: gclient sync --no-history --shallow run: gclient sync --no-history --shallow env: - GIT_CACHE_PATH: ${{ steps.strings.outputs.gclient-cache-dir }} DEPOT_TOOLS_WIN_TOOLCHAIN: 0 - - name: gclient save cache - id: gclient-save - uses: actions/cache/save@v3 - if: steps.gclient-save.outputs.cache-hit != 'true' - with: - path: ${{ steps.strings.outputs.gclient-cache-dir }} - key: ${{ steps.gclient-restore.outputs.cache-primary-key }} - - name: Set up sccache uses: mozilla-actions/sccache-action@v0.0.3 @@ -75,11 +50,12 @@ jobs: shell: bash run: | mkdir -p out/build - touch out/build/args.gn - echo "cc_wrapper=\"sccache\"" >> out/build/args.gn - echo "is_debug=true" >> out/build/args.gn - echo "is_component_build=true" >> out/build/args.gn - echo "is_clang=true" >> out/build/args.gn + cat << EOF >> out/build/args.gn + cc_wrapper="sccache" + is_debug=false + is_component_build=true + is_clang=true + EOF gn gen out/build env: From 43968197ffd2a497ec697aa0ae9923b52f44b6c2 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:00:15 -0800 Subject: [PATCH 23/35] update go workflow comment --- .github/workflows/go.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bb098260576..0bf1a419b99 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,6 +1,4 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - +# Workflow to build and run go tests name: Go on: @@ -11,7 +9,7 @@ on: jobs: - build: + build-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From a329d588e7f78f79eff23bc393db81e8c8e59d02 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:44:17 -0800 Subject: [PATCH 24/35] update comments --- .github/workflows/cmake.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 63d86acb633..91f3c0b0242 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -19,12 +19,6 @@ jobs: # 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 3 configurations: - # 1. - # 2. - # 3. - # - # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: os: [ubuntu-latest, windows-latest, macos-latest] build_type: [Debug, Release] @@ -85,8 +79,6 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.3 - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: > cmake -G Ninja -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} @@ -99,7 +91,6 @@ jobs: SCCACHE_GHA_ENABLED: "true" - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} env: SCCACHE_GHA_ENABLED: "true" From 48d69261fb37c3b1097f1c9d2968bdddc59d5ae9 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:13:39 -0800 Subject: [PATCH 25/35] add upload/download of artifacts --- .github/workflows/cmake.yml | 15 +++++++++++++++ .github/workflows/gn.yml | 30 ++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 91f3c0b0242..88db7840aa5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -53,6 +53,14 @@ jobs: shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + echo "build-key=${{ runner.os }}-${{github.workflow}}-${{ matrix.build_type }}-${{ matrix.c_compiler }}" >> "$GITHUB_OUTPUT" + + # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. + - uses: actions/download-artifact@v3 + if: ${{ github.event_name == 'pull_request' }} + with: + name: workspace-${{ steps.strings.outputs.build-key }} + path: ${{ github.workspace }} - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' @@ -94,3 +102,10 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} env: SCCACHE_GHA_ENABLED: "true" + + # Always upload workspace artifacts. Eventually only do this for pushes to main. + - uses: actions/upload-artifact@v3 + with: + name: workspace-${{ steps.strings.outputs.build-key }} + path: ${{ github.workspace }} + retention-days: 7 diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index cc0fbf1c8e6..3a5816002d7 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -34,6 +34,21 @@ jobs: - 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" + echo "build-key=${{ runner.os }}-${{github.workflow}}" >> "$GITHUB_OUTPUT" + + # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. + - uses: actions/download-artifact@v3 + if: ${{ github.event_name == 'pull_request' }} + with: + name: workspace-${{ steps.strings.outputs.build-key }} + path: ${{ github.workspace }} + - name: Set up checkout run: | cp ./scripts/standalone.gclient .gclient @@ -49,21 +64,28 @@ jobs: - name: Generate build files shell: bash run: | - mkdir -p out/build - cat << EOF >> out/build/args.gn + 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 out/build + gn gen ${{ steps.strings.outputs.build-output-dir }} env: SCCACHE_GHA_ENABLED: "true" DEPOT_TOOLS_WIN_TOOLCHAIN: 0 - name: Build - run: autoninja -C out/build + run: autoninja -C ${{ steps.strings.outputs.build-output-dir }} env: SCCACHE_GHA_ENABLED: "true" DEPOT_TOOLS_WIN_TOOLCHAIN: 0 + + # Always upload workspace artifacts. Eventually only do this for pushes to main. + - uses: actions/upload-artifact@v3 + with: + name: workspace-${{ steps.strings.outputs.build-key }} + path: ${{ github.workspace }} + retention-days: 7 From ccc74d58f1f860719499893b7b6eb227f182b59f Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:20:34 -0800 Subject: [PATCH 26/35] continue-on-error download-artifact --- .github/workflows/cmake.yml | 1 + .github/workflows/gn.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 88db7840aa5..76f8dde338e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -58,6 +58,7 @@ jobs: # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. - uses: actions/download-artifact@v3 if: ${{ github.event_name == 'pull_request' }} + continue-on-error: true with: name: workspace-${{ steps.strings.outputs.build-key }} path: ${{ github.workspace }} diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index 3a5816002d7..df98dbe0e7f 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -45,6 +45,7 @@ jobs: # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. - uses: actions/download-artifact@v3 if: ${{ github.event_name == 'pull_request' }} + continue-on-error: true with: name: workspace-${{ steps.strings.outputs.build-key }} path: ${{ github.workspace }} From 39c884124f51a846d053042a81eb416df97a0575 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:30:39 -0800 Subject: [PATCH 27/35] update download step --- .github/workflows/cmake.yml | 11 ++++++++--- .github/workflows/gn.yml | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 76f8dde338e..02e2263a0fa 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -56,12 +56,16 @@ jobs: echo "build-key=${{ runner.os }}-${{github.workflow}}-${{ matrix.build_type }}-${{ matrix.c_compiler }}" >> "$GITHUB_OUTPUT" # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. - - uses: actions/download-artifact@v3 + - name: Download workspace artifacts + uses: dawidd6/action-download-artifact@v2 if: ${{ github.event_name == 'pull_request' }} - continue-on-error: true with: + workflow: ${{ github.workflow }} + workflow_conclusion: success name: workspace-${{ steps.strings.outputs.build-key }} + search_artifacts: true path: ${{ github.workspace }} + if_no_artifact_found: "warn" - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' @@ -105,7 +109,8 @@ jobs: SCCACHE_GHA_ENABLED: "true" # Always upload workspace artifacts. Eventually only do this for pushes to main. - - uses: actions/upload-artifact@v3 + - name: Upload workspace artifacts + uses: actions/upload-artifact@v3 with: name: workspace-${{ steps.strings.outputs.build-key }} path: ${{ github.workspace }} diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index df98dbe0e7f..56bb508f3ec 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -43,12 +43,16 @@ jobs: echo "build-key=${{ runner.os }}-${{github.workflow}}" >> "$GITHUB_OUTPUT" # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. - - uses: actions/download-artifact@v3 + - name: Download workspace artifacts + uses: dawidd6/action-download-artifact@v2 if: ${{ github.event_name == 'pull_request' }} - continue-on-error: true with: + workflow: ${{ github.workflow }} + workflow_conclusion: success name: workspace-${{ steps.strings.outputs.build-key }} + search_artifacts: true path: ${{ github.workspace }} + if_no_artifact_found: "warn" - name: Set up checkout run: | @@ -85,7 +89,8 @@ jobs: DEPOT_TOOLS_WIN_TOOLCHAIN: 0 # Always upload workspace artifacts. Eventually only do this for pushes to main. - - uses: actions/upload-artifact@v3 + - name: Upload workspace artifacts + uses: actions/upload-artifact@v3 with: name: workspace-${{ steps.strings.outputs.build-key }} path: ${{ github.workspace }} From 49e93a5caa9130f99db71aa2484b974309074c90 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:43:42 -0800 Subject: [PATCH 28/35] update --- .github/workflows/cmake.yml | 6 +++--- .github/workflows/gn.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 02e2263a0fa..2867559f369 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -64,8 +64,8 @@ jobs: workflow_conclusion: success name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true - path: ${{ github.workspace }} - if_no_artifact_found: "warn" + path: ${{ steps.strings.outputs.build-output-dir }} + if_no_artifact_found: warn - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' @@ -113,5 +113,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: workspace-${{ steps.strings.outputs.build-key }} - path: ${{ github.workspace }} + path: ${{ steps.strings.outputs.build-output-dir }} retention-days: 7 diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index 56bb508f3ec..2290fbb0459 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -51,8 +51,8 @@ jobs: workflow_conclusion: success name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true - path: ${{ github.workspace }} - if_no_artifact_found: "warn" + path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} + if_no_artifact_found: warn - name: Set up checkout run: | @@ -93,5 +93,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: workspace-${{ steps.strings.outputs.build-key }} - path: ${{ github.workspace }} + path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} retention-days: 7 From 95580180d9ca1a05f85cace0207e4b2905011a20 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:46:40 -0800 Subject: [PATCH 29/35] update --- .github/workflows/cmake.yml | 2 +- .github/workflows/gn.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2867559f369..a2014c05a5c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,7 +65,7 @@ jobs: name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true path: ${{ steps.strings.outputs.build-output-dir }} - if_no_artifact_found: warn + if_no_artifact_found: ignore - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index 2290fbb0459..99ef5c2b44f 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -52,7 +52,7 @@ jobs: name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} - if_no_artifact_found: warn + if_no_artifact_found: ignore - name: Set up checkout run: | From a4471cffe5e98c32d691c67c5894b88f9b758c66 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:47:44 -0800 Subject: [PATCH 30/35] update --- .github/workflows/cmake.yml | 2 +- .github/workflows/gn.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a2014c05a5c..d4cf707fd61 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,7 +65,7 @@ jobs: name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true path: ${{ steps.strings.outputs.build-output-dir }} - if_no_artifact_found: ignore + continue-on-error: true - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index 99ef5c2b44f..86491aa6b06 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -52,7 +52,7 @@ jobs: name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} - if_no_artifact_found: ignore + continue-on-error: true - name: Set up checkout run: | From bf674031b46610d79c110229b138980fdf5e15ba Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:50:28 -0800 Subject: [PATCH 31/35] update cmake build out dir --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d4cf707fd61..03d9d432242 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -52,7 +52,7 @@ jobs: id: strings shell: bash run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + echo "build-output-dir=${{ github.workspace }}/out/build" >> "$GITHUB_OUTPUT" echo "build-key=${{ runner.os }}-${{github.workflow}}-${{ matrix.build_type }}-${{ matrix.c_compiler }}" >> "$GITHUB_OUTPUT" # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. From e411f4053c54cb7aefffb83ffd4082007f4f242b Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:27:37 -0800 Subject: [PATCH 32/35] warn on missing artifacts --- .github/workflows/cmake.yml | 1 + .github/workflows/gn.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 03d9d432242..48f834aa149 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,6 +65,7 @@ jobs: name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true path: ${{ steps.strings.outputs.build-output-dir }} + if_no_artifact_found: warn continue-on-error: true - name: Install Ubuntu build dependencies diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index 86491aa6b06..c57cf2fdaae 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -52,6 +52,7 @@ jobs: name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} + if_no_artifact_found: warn continue-on-error: true - name: Set up checkout From f80f996dc2a66c434c08d6ba4e715d7a43fcc194 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:32:29 -0800 Subject: [PATCH 33/35] update artifact download --- .github/workflows/cmake.yml | 1 - .github/workflows/gn.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 48f834aa149..bce96cc6798 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -60,7 +60,6 @@ jobs: uses: dawidd6/action-download-artifact@v2 if: ${{ github.event_name == 'pull_request' }} with: - workflow: ${{ github.workflow }} workflow_conclusion: success name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index c57cf2fdaae..e603dc529d1 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -47,7 +47,6 @@ jobs: uses: dawidd6/action-download-artifact@v2 if: ${{ github.event_name == 'pull_request' }} with: - workflow: ${{ github.workflow }} workflow_conclusion: success name: workspace-${{ steps.strings.outputs.build-key }} search_artifacts: true From 70e9f3d634c52b03c8c8256631f1a63b1eddeef7 Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:44:40 -0800 Subject: [PATCH 34/35] delete artifact upload/download; it is not faster --- .github/workflows/cmake.yml | 21 --------------------- .github/workflows/gn.yml | 21 --------------------- 2 files changed, 42 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bce96cc6798..ddd06b5acdc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -53,19 +53,6 @@ jobs: shell: bash run: | echo "build-output-dir=${{ github.workspace }}/out/build" >> "$GITHUB_OUTPUT" - echo "build-key=${{ runner.os }}-${{github.workflow}}-${{ matrix.build_type }}-${{ matrix.c_compiler }}" >> "$GITHUB_OUTPUT" - - # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. - - name: Download workspace artifacts - uses: dawidd6/action-download-artifact@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - workflow_conclusion: success - name: workspace-${{ steps.strings.outputs.build-key }} - search_artifacts: true - path: ${{ steps.strings.outputs.build-output-dir }} - if_no_artifact_found: warn - continue-on-error: true - name: Install Ubuntu build dependencies if: matrix.os == 'ubuntu-latest' @@ -107,11 +94,3 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} env: SCCACHE_GHA_ENABLED: "true" - - # Always upload workspace artifacts. Eventually only do this for pushes to main. - - name: Upload workspace artifacts - uses: actions/upload-artifact@v3 - with: - name: workspace-${{ steps.strings.outputs.build-key }} - path: ${{ steps.strings.outputs.build-output-dir }} - retention-days: 7 diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml index e603dc529d1..f70f6883b0a 100644 --- a/.github/workflows/gn.yml +++ b/.github/workflows/gn.yml @@ -40,19 +40,6 @@ jobs: shell: bash run: | echo "build-output-dir=out/build" >> "$GITHUB_OUTPUT" - echo "build-key=${{ runner.os }}-${{github.workflow}}" >> "$GITHUB_OUTPUT" - - # Only download workspace artifacts on pull requests. CI builds should start from a fresh state. - - name: Download workspace artifacts - uses: dawidd6/action-download-artifact@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - workflow_conclusion: success - name: workspace-${{ steps.strings.outputs.build-key }} - search_artifacts: true - path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} - if_no_artifact_found: warn - continue-on-error: true - name: Set up checkout run: | @@ -87,11 +74,3 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" DEPOT_TOOLS_WIN_TOOLCHAIN: 0 - - # Always upload workspace artifacts. Eventually only do this for pushes to main. - - name: Upload workspace artifacts - uses: actions/upload-artifact@v3 - with: - name: workspace-${{ steps.strings.outputs.build-key }} - path: ${{ github.workspace }}/${{ steps.strings.outputs.build-output-dir }} - retention-days: 7 From aefd0f48e0bc119579781da17daf6c6c94a6723c Mon Sep 17 00:00:00 2001 From: Austin Eng <2154796+austinEng@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:01:17 -0800 Subject: [PATCH 35/35] unify under ci.yml --- .github/workflows/{cmake.yml => ci.yml} | 88 +++++++++++++++++++++++-- .github/workflows/gn.yml | 76 --------------------- .github/workflows/go.yml | 26 -------- 3 files changed, 84 insertions(+), 106 deletions(-) rename .github/workflows/{cmake.yml => ci.yml} (54%) delete mode 100644 .github/workflows/gn.yml delete mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/ci.yml similarity index 54% rename from .github/workflows/cmake.yml rename to .github/workflows/ci.yml index ddd06b5acdc..b58853a7477 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,80 @@ -# Workflow to build Dawn using CMake -name: CMake +name: CI on: push: branches: [ "main" ] pull_request: - branches: [ "main" ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - build: + 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/setup-depot-tools@v1.0.1 + + - 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/sccache-action@v0.0.3 + + - 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 @@ -44,6 +104,9 @@ jobs: - 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 @@ -94,3 +157,20 @@ jobs: 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 ./... diff --git a/.github/workflows/gn.yml b/.github/workflows/gn.yml deleted file mode 100644 index f70f6883b0a..00000000000 --- a/.github/workflows/gn.yml +++ /dev/null @@ -1,76 +0,0 @@ -# Workflow to build Dawn using GN -name: GN - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ${{ matrix.os }} - - 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] - - 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/setup-depot-tools@v1.0.1 - - - 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/sccache-action@v0.0.3 - - - 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 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 0bf1a419b99..00000000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Workflow to build and run go tests -name: Go - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - - build-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 ./...