diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/cmake.yml | 62 | ||||
-rw-r--r-- | .github/workflows/configure.yml | 46 | ||||
-rw-r--r-- | .github/workflows/fuzz.yml | 25 |
3 files changed, 133 insertions, 0 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..ed3a79b --- /dev/null +++ b/.github/workflows/cmake.yml | |||
@@ -0,0 +1,62 @@ | |||
1 | name: CMake | ||
2 | on: [push, pull_request] | ||
3 | jobs: | ||
4 | ci-cmake: | ||
5 | name: ${{ matrix.name }} | ||
6 | runs-on: ${{ matrix.os }} | ||
7 | strategy: | ||
8 | fail-fast: false | ||
9 | matrix: | ||
10 | include: | ||
11 | - name: Ubuntu GCC | ||
12 | os: ubuntu-latest | ||
13 | compiler: gcc | ||
14 | |||
15 | - name: Ubuntu GCC ISB | ||
16 | os: ubuntu-latest | ||
17 | compiler: gcc | ||
18 | build-dir: "." | ||
19 | src-dir: "." | ||
20 | |||
21 | - name: Ubuntu Clang | ||
22 | os: ubuntu-latest | ||
23 | compiler: clang | ||
24 | |||
25 | - name: Ubuntu Clang Debug | ||
26 | os: ubuntu-latest | ||
27 | compiler: clang | ||
28 | build-config: Debug | ||
29 | |||
30 | - name: Windows MSVC Win32 | ||
31 | os: windows-latest | ||
32 | compiler: cl | ||
33 | cmake-args: -A Win32 | ||
34 | |||
35 | - name: Windows MSVC Win64 | ||
36 | os: windows-latest | ||
37 | compiler: cl | ||
38 | cmake-args: -A x64 | ||
39 | |||
40 | - name: macOS Clang | ||
41 | os: macos-latest | ||
42 | compiler: clang | ||
43 | |||
44 | - name: macOS GCC | ||
45 | os: macos-latest | ||
46 | compiler: gcc-9 | ||
47 | |||
48 | steps: | ||
49 | - name: Checkout repository | ||
50 | uses: actions/checkout@v3 | ||
51 | |||
52 | - name: Generate project files | ||
53 | run: cmake -S ${{ matrix.src-dir || '../zlib' }} -B ${{ matrix.build-dir || '../build' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} | ||
54 | env: | ||
55 | CC: ${{ matrix.compiler }} | ||
56 | |||
57 | - name: Compile source code | ||
58 | run: cmake --build ${{ matrix.build-dir || '../build' }} --config ${{ matrix.build-config || 'Release' }} | ||
59 | |||
60 | - name: Run test cases | ||
61 | run: ctest -C Release --output-on-failure --max-width 120 | ||
62 | working-directory: ${{ matrix.build-dir || '../build' }} | ||
diff --git a/.github/workflows/configure.yml b/.github/workflows/configure.yml new file mode 100644 index 0000000..2c19e60 --- /dev/null +++ b/.github/workflows/configure.yml | |||
@@ -0,0 +1,46 @@ | |||
1 | name: Configure | ||
2 | on: [push, pull_request] | ||
3 | jobs: | ||
4 | ci-configure: | ||
5 | name: ${{ matrix.name }} | ||
6 | runs-on: ${{ matrix.os }} | ||
7 | strategy: | ||
8 | fail-fast: false | ||
9 | matrix: | ||
10 | include: | ||
11 | - name: Ubuntu GCC | ||
12 | os: ubuntu-latest | ||
13 | compiler: gcc | ||
14 | configure-args: --warn | ||
15 | |||
16 | - name: Ubuntu GCC ISB | ||
17 | os: ubuntu-latest | ||
18 | compiler: gcc | ||
19 | configure-args: --warn | ||
20 | build-dir: "." | ||
21 | src-dir: "." | ||
22 | |||
23 | - name: macOS GCC | ||
24 | os: macos-latest | ||
25 | compiler: gcc-9 | ||
26 | configure-args: --warn | ||
27 | |||
28 | steps: | ||
29 | - name: Checkout repository | ||
30 | uses: actions/checkout@v3 | ||
31 | |||
32 | - name: Generate project files | ||
33 | run: | | ||
34 | [ -d ${{ matrix.build-dir || '../build' }} ] || mkdir ${{ matrix.build-dir || '../build' }} | ||
35 | cd ${{ matrix.build-dir || '../build' }} | ||
36 | ${{ matrix.src-dir || '../zlib' }}/configure ${{ matrix.configure-args }} | ||
37 | env: | ||
38 | CC: ${{ matrix.compiler }} | ||
39 | |||
40 | - name: Compile source code | ||
41 | run: make -j2 | ||
42 | working-directory: ${{ matrix.build-dir }} | ||
43 | |||
44 | - name: Run test cases | ||
45 | run: make test | ||
46 | working-directory: ${{ matrix.build-dir }} | ||
diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml new file mode 100644 index 0000000..48cd2b9 --- /dev/null +++ b/.github/workflows/fuzz.yml | |||
@@ -0,0 +1,25 @@ | |||
1 | name: OSS-Fuzz | ||
2 | on: [pull_request] | ||
3 | jobs: | ||
4 | Fuzzing: | ||
5 | runs-on: ubuntu-latest | ||
6 | steps: | ||
7 | - name: Build Fuzzers | ||
8 | uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master | ||
9 | with: | ||
10 | oss-fuzz-project-name: 'zlib' | ||
11 | dry-run: false | ||
12 | |||
13 | - name: Run Fuzzers | ||
14 | uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master | ||
15 | with: | ||
16 | oss-fuzz-project-name: 'zlib' | ||
17 | fuzz-seconds: 300 | ||
18 | dry-run: false | ||
19 | |||
20 | - name: Upload Crash | ||
21 | uses: actions/upload-artifact@v3 | ||
22 | if: failure() | ||
23 | with: | ||
24 | name: artifacts | ||
25 | path: ./out/artifacts | ||