-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added continuous integration workflows for GitHub Actions. On each co…
…mmit these workflows will be run to verify that project generation, source file compilation, and test cases run successfully. On each pull request a workflow will be run to verify that all fuzzing tests pass successfully. #492
- Loading branch information
Showing
3 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: CMake | ||
on: [push, pull_request] | ||
jobs: | ||
ci-cmake: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: Ubuntu GCC | ||
os: ubuntu-latest | ||
compiler: gcc | ||
|
||
- name: Ubuntu GCC OSB | ||
os: ubuntu-latest | ||
compiler: gcc | ||
build-dir: ../build | ||
build-src-dir: ../zlib | ||
|
||
- name: Ubuntu Clang | ||
os: ubuntu-latest | ||
compiler: clang | ||
|
||
- name: Ubuntu Clang Debug | ||
os: ubuntu-latest | ||
compiler: clang | ||
build-config: Debug | ||
|
||
- name: Windows MSVC Win32 | ||
os: windows-latest | ||
compiler: cl | ||
cmake-args: -A Win32 | ||
|
||
- name: Windows MSVC Win64 | ||
os: windows-latest | ||
compiler: cl | ||
cmake-args: -A x64 | ||
|
||
- name: macOS Clang | ||
os: macOS-latest | ||
compiler: clang | ||
|
||
- name: macOS GCC | ||
os: macOS-latest | ||
compiler: gcc | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Generate project files | ||
run: | | ||
mkdir ${{ matrix.build-dir || '.not-used' }} | ||
cd ${{ matrix.build-dir || '.' }} | ||
cmake ${{ matrix.build-src-dir || '.' }} ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} | ||
env: | ||
CC: ${{ matrix.compiler }} | ||
CFLAGS: ${{ matrix.cflags }} | ||
LDFLAGS: ${{ matrix.ldflags }} | ||
CI: true | ||
|
||
- name: Compile source code | ||
run: | | ||
cd ${{ matrix.build-dir || '.' }} | ||
cmake --build . --config ${{ matrix.build-config || 'Release' }} | ||
- name: Run test cases | ||
run: | | ||
cd ${{ matrix.build-dir || '.' }} | ||
ctest -C Release --output-on-failure --max-width 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Configure | ||
on: [push, pull_request] | ||
jobs: | ||
ci-configure: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: Ubuntu GCC | ||
os: ubuntu-latest | ||
compiler: gcc | ||
configure-args: --warn | ||
|
||
- name: Ubuntu GCC OSB | ||
os: ubuntu-latest | ||
compiler: gcc | ||
configure-args: --warn | ||
build-dir: ../build | ||
build-src-dir: ../zlib | ||
|
||
- name: macOS GCC | ||
os: macOS-latest | ||
compiler: gcc | ||
configure-args: --warn | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Generate project files | ||
run: | | ||
mkdir ${{ matrix.build-dir || '.not-used' }} | ||
cd ${{ matrix.build-dir || '.' }} | ||
${{ matrix.build-src-dir || '.' }}/configure ${{ matrix.configure-args }} | ||
env: | ||
CC: ${{ matrix.compiler }} | ||
CI: true | ||
|
||
- name: Compile source code | ||
run: | | ||
cd ${{ matrix.build-dir || '.' }} | ||
make -j2 | ||
- name: Run test cases | ||
run: | | ||
cd ${{ matrix.build-dir || '.' }} | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: OSS-Fuzz | ||
on: [pull_request] | ||
jobs: | ||
Fuzzing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build Fuzzers | ||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'zlib' | ||
dry-run: false | ||
|
||
- name: Run Fuzzers | ||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'zlib' | ||
fuzz-seconds: 600 | ||
dry-run: false | ||
|
||
- name: Upload Crash | ||
uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: artifacts | ||
path: ./out/artifacts |