ci.yml
1 name: CI 2 3 on: 4 push: 5 branches: "*" 6 pull_request: 7 branches: "*" 8 9 permissions: {} 10 11 jobs: 12 # On Ubuntu, because that is the standard OS of GitHub Actions. 13 build_ubuntu: 14 15 runs-on: ubuntu-latest 16 17 steps: 18 - name: Install build dependencies 19 run: | 20 sudo apt-get update 21 sudo apt-get dist-upgrade -y 22 sudo apt-get install -y --no-install-recommends libusb-1.0-0-dev libsystemd-dev libev-dev libfmt-dev libinih-dev 23 24 - uses: actions/checkout@v4 25 with: 26 fetch-depth: 0 # Full history to be able to determine version number 27 28 - name: Bootstrap 29 run: sh bootstrap.sh 30 31 - name: Configure 32 run: ./configure 33 34 - name: Build 35 run: make -j$(nproc) 36 37 - name: Test 38 run: make -j1 test 39 40 - name: Install 41 run: sudo make -j1 install 42 43 # On Alpine, because it's a tiny distro heavily used in containers. 44 build_alpine: 45 46 runs-on: ubuntu-latest 47 container: alpine 48 49 steps: 50 - name: Install build dependencies 51 run: | 52 apk update 53 apk upgrade 54 apk add git build-base autoconf automake libtool argp-standalone linux-headers libusb-dev libev-dev fmt-dev inih-dev 55 56 - name: Configure git in container 57 run: | 58 git config --global --add safe.directory "$GITHUB_WORKSPACE" 59 60 - uses: actions/checkout@v4 61 with: 62 fetch-depth: 0 # Full history to be able to determine version number 63 64 - name: Bootstrap 65 run: sh bootstrap.sh 66 67 - name: Configure 68 run: ./configure --disable-systemd 69 70 - name: Build 71 run: make -j$(nproc) 72 73 - name: Test 74 run: make -j1 test 75 76 - name: Install 77 run: make -j1 install 78 79 # Debian packaging; May break when code changes require updates to the Debian package. 80 # Merges the pushed/proposed code changes to the `debian` branch and builds that then. 81 package_debian: 82 83 strategy: 84 fail-fast: false 85 matrix: 86 suite: [testing, stable, oldstable] 87 runs-on: ubuntu-latest 88 container: debian:${{ matrix.suite }}-slim 89 90 steps: 91 - name: Install dependencies 92 run: | 93 apt-get update 94 apt-get dist-upgrade -y 95 apt-get autoremove -y --purge 96 apt-get install -y --no-install-recommends ca-certificates git sudo 97 98 - name: Configure git in container 99 run: | 100 git config --global --add safe.directory "$GITHUB_WORKSPACE" 101 git config --global user.name "Your Name" 102 git config --global user.email "you@example.com" 103 104 - uses: actions/checkout@v4 105 with: 106 fetch-depth: 0 # Full history to be able to determine version number 107 108 - name: Merge with debian branch 109 run: | 110 git switch -C ci origin/debian 111 git merge origin/main 112 113 - name: Build and install 114 run: sh install-debian.sh