File: test.yml

package info (click to toggle)
zkg 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,740 kB
  • sloc: python: 5,910; sh: 268; makefile: 265; cpp: 24
file content (77 lines) | stat: -rw-r--r-- 2,306 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Test and upload Python package

on:
  pull_request:
  push:
    branches: [master]
    tags:
      - 'v*'
      - '!v*-dev'

env:
  ZEEKROOT: /usr/local/zeek

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        # Test Zeek LTS, latest, and nightly, and
        # don't fail for the nightly one.
        include:
          - repo: zeek
            version: latest
            continue_on_error: false
          - repo: zeek
            version: lts
            continue_on_error: false
          - repo: zeek-dev
            version: latest
            continue_on_error: true

    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.continue_on_error }}
    container:
      image: zeek/${{ matrix.repo }}:${{ matrix.version }}

    steps:
      - name: Install build environment
        run: |
          apt-get update
          apt-get install -y --no-install-recommends cmake g++ libssl-dev libpcap-dev make
      - name: Remove zkg installation
        # Rule out confusion between test environment and pre-existing zkg:
        run: |
          rm $ZEEKROOT/bin/zkg $ZEEKROOT/share/man/man1/zkg.1
          rm -r $ZEEKROOT/etc/zkg
          rm -r $ZEEKROOT/lib/zeek/python/zeekpkg
          rm -r $ZEEKROOT/var/lib/zkg
      - uses: actions/checkout@v4
      - name: Run unit tests
        run: btest -j -A -d -c testing/btest.cfg
      - uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: btest-${{ matrix.repo }}-${{ matrix.version }}
          path: testing/.tmp/

  upload:
    runs-on: ubuntu-latest
    needs: [test]
    if: github.repository == 'zeek/package-manager' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
    steps:
      - uses: actions/checkout@v4
      - name: Check release version
        # This fails e.g. if VERSION contains a dev commits suffix,
        # since we don't want to push these to PyPI. Accepts two-
        # and three-component version numbers (e.g. 1.0 and 1.0.1).
        run: |
          grep -E -x '[0-9]+\.[0-9]+(\.[0-9]+)?' VERSION
      - name: Build wheel
        run: |
          make dist
      - name: Upload to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          user: __token__
          password: ${{ secrets.PYPI_API_TOKEN }}