File: tests.yml

package info (click to toggle)
golang-github-checkpoint-restore-checkpointctl 1.3.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 524 kB
  • sloc: ansic: 208; makefile: 172; sh: 40
file content (69 lines) | stat: -rw-r--r-- 1,960 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
name: Run Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: registry.fedoraproject.org/fedora:latest
      options: --privileged --cap-add=NET_ADMIN --cap-add=NET_RAW -v /lib/modules:/lib/modules
    steps:
      - uses: actions/checkout@v4
      - name: Install tools
        run: |
          sudo dnf -y install ShellCheck bats golang criu asciidoctor iptables iproute kmod jq bash bash-completion zsh fish
          sudo modprobe -va ip_tables ip6table_filter nf_conntrack nf_conntrack_netlink
      - name: Run make shellcheck
        run: make shellcheck
      - name: Run make all
        run: make all
      - name: Run make test
        run: sudo -E make test
      - name: Run make test-junit
        run: sudo -E make test-junit
      - name: Upload Test Results
        # To display test results from forked repositories they need to
        # be uploaded and then analyzed.
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: test-results
          retention-days: 1
          path: test/junit.xml
      - name: Run make install/uninstall
        run: test/uninstall.sh
      - name: Run make validate.completions
        run: make validate.completions

  event_file:
    name: "Event File"
    runs-on: ubuntu-latest
    steps:
    - name: Upload
      if: always()
      uses: actions/upload-artifact@v4
      with:
        name: event-file
        retention-days: 1
        path: ${{ github.event_path }}

  release:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Build release binary
      run: make release

    - name: Check static binary
      run: |
        file_output=$(file checkpointctl)
        if [[ "$file_output" =~ .*statically\ linked.* ]]; then
          echo "Binary is static"
          exit 0
        else
          echo "Binary is not static"
          exit 1
        fi