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

Fixes for all of the GitHub workflows #60

Merged
merged 7 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
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
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