Skip to content

Commit

Permalink
Merge branch 'topic/timw/workflow-fixes'
Browse files Browse the repository at this point in the history
* topic/timw/workflow-fixes:
  Add section about building for Windows to README
  CI: Use correct vcpkg root for Windows builds
  Update vcpkg to 2023.11.20
  Update doctest to v2.4.11
  CI: Update ubuntu builds to use zeek 5.0.9 for ubuntu22, remove zeek 4.0 build
  CI: Update github actions used across all jobs
  CI: Update to macOS 13
  • Loading branch information
timwoj committed Dec 1, 2023
2 parents f3484a0 + cd5f443 commit a263825
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 26 deletions.
52 changes: 29 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
zeek: [{version: 4.0.4-0, tag: -lts}, {version: 5.0.0-0, tag: -rc}]
zeek: [{version: 5.0.9-0, tag: -lts}]

env:
ZEEK_VERSION: ${{ matrix.zeek.version }}
Expand All @@ -25,17 +25,17 @@ jobs:
- name: Install Zeek
run: |
(cd /tmp && curl -L -O https://download.zeek.org/binary-packages/xUbuntu_20.04/amd64/zeek${ZEEK_TAG}-core_${ZEEK_VERSION}_amd64.deb)
(cd /tmp && curl -L -O https://download.zeek.org/binary-packages/xUbuntu_22.04/amd64/zeek${ZEEK_TAG}-core_${ZEEK_VERSION}_amd64.deb)
sudo apt install -y /tmp/zeek${ZEEK_TAG}-core_${ZEEK_VERSION}_amd64.deb
echo "/opt/zeek/bin:$PATH" >> $GITHUB_PATH
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up ccache
uses: hendrikmuhs/[email protected].2
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

Expand All @@ -54,7 +54,7 @@ jobs:
# TODO: tidy fails in Broker currently
# ninja -C build tidy
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Test output
Expand All @@ -78,12 +78,12 @@ jobs:
pip3 install btest zkg
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up ccache
uses: hendrikmuhs/[email protected].2
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

Expand All @@ -107,30 +107,36 @@ jobs:
ninja -C build package
(cd build/dist && echo "ZA_DIST=$(echo *.tar.gz)" >>$GITHUB_ENV)
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{env.ZA_DIST}}
path: build/dist/${{env.ZA_DIST}}

# TODO: Install Zeek and run Zeek tests.
release_macos_11:
runs-on: macos-11
release_macos_13:
runs-on: macos-13
environment: ${{ (github.ref == 'refs/heads/main' || (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-dev'))) && 'release' || '' }}

steps:
- name: Prepare
run: |
brew update
brew unlink python
brew link --overwrite python
brew upgrade --force python
brew upgrade --force php
brew upgrade
brew install ninja ccache
pip3 install btest zkg
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up ccache
uses: hendrikmuhs/[email protected].2
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

Expand Down Expand Up @@ -207,7 +213,7 @@ jobs:
### Back to running on all branches

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{env.ZA_DIST}}
path: build/dist/${{env.ZA_DIST}}
Expand All @@ -226,7 +232,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -244,7 +250,7 @@ jobs:
shell: cmd

- name: Set up ccache
uses: hendrikmuhs/[email protected].2
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

Expand All @@ -267,7 +273,7 @@ jobs:
- name: Configure
run: >
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_MAKE_PROGRAM=ninja.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CCACHE=yes -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TARGET_TRIPLET}}
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_MAKE_PROGRAM=ninja.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CCACHE=yes -DCMAKE_TOOLCHAIN_FILE="3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TARGET_TRIPLET}}
shell: cmd

- name: Build
Expand All @@ -290,7 +296,7 @@ jobs:
(cd build/dist && echo "ZA_DIST=$(echo *.msi)" >>$GITHUB_ENV)
shell: bash

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{env.ZA_DIST}}
path: build/dist/${{env.ZA_DIST}}
Expand All @@ -307,12 +313,12 @@ jobs:
sudo apt-get install -y ninja-build ccache curl ca-certificates
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up ccache
uses: hendrikmuhs/[email protected].2
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

Expand All @@ -331,7 +337,7 @@ jobs:
cat build/dist/${{env.ZA_DIST}} | (cd ${{ runner.temp }}/test-build && tar xzvf -)
(cd $(echo ${{ runner.temp }}/test-build/zeek-agent*) && ./configure --generator=Ninja --enable-ccache && ninja -C build && ninja -C build test)
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{env.ZA_DIST}}
path: build/dist/${{env.ZA_DIST}}
Expand All @@ -341,10 +347,10 @@ jobs:
contents: write
runs-on: ubuntu-latest
if: (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-dev'))
needs: [debug_ubuntu_latest, release_alpine_3_15_static, release_macos_11, release_windows_2022, release_source]
needs: [debug_ubuntu_latest, release_alpine_3_15_static, release_macos_13, release_windows_2022, release_source]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -353,7 +359,7 @@ jobs:
cat CHANGES | awk '/^[0-9]+\./{ n++; next; } n < 2 { print }' >${{ runner.temp }}/release-msg
echo "release_name=$(echo ${{ github.ref_name }} | sed 's/^v//')" >> $GITHUB_ENV
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
path: artifacts

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/doctest
2 changes: 1 addition & 1 deletion 3rdparty/vcpkg
Submodule vcpkg updated 9209 files
26 changes: 26 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
2.3.0-dev.55 | 2023-12-01 09:42:11 -0700

* Add section about building for Windows to README

* CI: Use correct vcpkg root for Windows builds

* Update vcpkg to 2023.11.20

This fixes the build on Windows failing to find zlib.

* Update doctest to v2.4.11

This fixes, among other things, build failures on macOS due to sprintf
being fully deprecated in XCode 14.

* CI: Update ubuntu builds to use zeek 5.0.9 for ubuntu22, remove zeek 4.0 build

* CI: Update github actions used across all jobs

* CI: Update to macOS 13

GitHub's action runner complains that we're still trying to use macOS 11
and is killing the builds. This requires some tinkering with the brew
packages that are installed, but don't like to update cleanly (python
and php specifically).

2.3.0-dev.47 | 2022-11-29 15:58:23 -0800

* Minor grammar fixes (William Stearns)
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ Selected `configure` options (see `--help` for more):

On macOS with Homebrew, use `--with-openssl={/usr/local,/opt/homebrew}/opt/[email protected]`

##### Windows

For Windows builds, any recent version of Visual Studio will work. You will need
to pass `-DCMAKE_TOOLCHAIN_FILE="3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake"`
to the CMake invocation. This will make vcpkg install the proper dependencies for
the build.

#### Usage

On all endpoints, run as `root`:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-dev.47
2.3.0-dev.55
1 change: 1 addition & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "main",
"version-string": "latest",
"dependencies": [
"pthreads",
"openssl",
"zlib"
]
Expand Down

0 comments on commit a263825

Please sign in to comment.