Skip to content

Commit

Permalink
ci: update GitHub Actions worflows
Browse files Browse the repository at this point in the history
ci: use clang-format-12

(cherry picked from commit 7e1a2d8)

ci: replace windows-2016 agent

(cherry picked from commit 9e60f81)

ci: use actions/checkout@v3

(cherry picked from commit d848720)

ci: fix iwyu

(cherry picked from commit 47868f9)
  • Loading branch information
gjasny committed May 20, 2022
1 parent d552d60 commit 76470b3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bazel-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, windows-2019]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Generate German locale on Ubuntu
if: runner.os == 'Linux'
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/cmake-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-18.04, windows-2016]
os: [macOS-latest, ubuntu-18.04, windows-2019]
dependencies: [submodule, vcpkg]
steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Checkout submodules
if: matrix.dependencies == 'submodule'
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
uses: actions/checkout@v3
with:
submodules: ${{ matrix.dependencies == 'submodule' }}

- name: Mount vcpkg cache
if: matrix.dependencies == 'vcpkg'
Expand All @@ -29,6 +23,10 @@ jobs:
path: "~/.cache/vcpkg/archives"
key: vcpkg-${{ matrix.os }}

- name: Default to x64-windows vcpkg triplet
if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
run: echo "VCPKG_DEFAULT_TRIPLET=x64-windows" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Install vcpkg dependencies
if: matrix.dependencies == 'vcpkg'
run: vcpkg install benchmark civetweb curl[core] gtest zlib
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Mount vcpkg cache
uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install doxygen
run: |
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@ jobs:
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates clang-12 cmake git iwyu libbenchmark-dev libcurl4-openssl-dev ninja-build zlib1g-dev
apt-get install -y --no-install-recommends ca-certificates clang-14 cmake git iwyu libbenchmark-dev libcurl4-openssl-dev ninja-build zlib1g-dev
- name: Checkout source
uses: actions/checkout@v2

- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
uses: actions/checkout@v3
with:
submodules: true

- name: "CMake Configure"
run: cmake -GNinja -DRUN_IWYU=ON -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -S ${GITHUB_WORKSPACE} -B ${GITHUB_WORKSPACE}/_build
run: cmake -GNinja -DRUN_IWYU=ON -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 -S ${GITHUB_WORKSPACE} -B ${GITHUB_WORKSPACE}/_build

- name: Build
run: cmake --build ${GITHUB_WORKSPACE}/_build 2>&1 | tee ${GITHUB_WORKSPACE}/output.txt
Expand All @@ -43,16 +38,18 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
sudo apt-get update
sudo apt-get install -y clang-format-11
# clang-format comes pre-installed
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
#- name: Install dependencies
# run: |
# sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
# sudo apt-get update
# sudo apt-get install -y clang-format-12

- name: Run clang-format
run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-11 -style=file -i {} \;
run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-12 -style=file -i {} \;

- name: Check for changes
run: git diff --exit-code
12 changes: 4 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: true

- name: Create tarball including submodules
shell: bash
Expand Down

0 comments on commit 76470b3

Please sign in to comment.