]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add CI builds for Ubuntu, OpenBSD, FreeBSD and NetBSD (#229)
authorTobias Heider <tobhe@users.noreply.github.com>
Fri, 4 Aug 2023 17:00:26 +0000 (19:00 +0200)
committerGitHub <noreply@github.com>
Fri, 4 Aug 2023 17:00:26 +0000 (18:00 +0100)
.github/workflows/build.yml [new file with mode: 0644]

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644 (file)
index 0000000..caacf7b
--- /dev/null
@@ -0,0 +1,86 @@
+name: Build
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+env:
+  CC: clang
+
+jobs:
+  ubuntu:
+    strategy:
+      matrix:
+        os: [ ubuntu-latest, ubuntu-22.04 ]
+    runs-on: ${{ matrix.os }}
+
+    steps:
+    - uses: actions/checkout@v2
+    
+    - name: Configure
+      run: ./configure --prefix=/usr
+
+    - name: Build
+      run: make
+
+  openbsd:
+    runs-on: macos-12
+    steps:
+    - name: Bootstrap OpenBSD-latest
+      uses: mario-campos/emulate@v1
+      with:
+        operating-system: openbsd-latest
+
+    - name: Install Dependencies
+      run: pkg_add git
+
+    - name: Build
+      run: |
+        git clone --depth=1 "${{ github.server_url }}/${{ github.repository }}" build
+        cd build
+        [ "${{ github.event.pull_request.number }}" = "" ] || (echo "fetching PR ${{ github.event.pull_request.number }}"; git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} && git checkout "pr-${{ github.event.pull_request.number }}")
+        echo "configure"
+        ./configure --prefix=/usr
+        echo "building"
+        make
+
+  freebsd:
+    runs-on: macos-12
+    steps:
+    - name: Bootstrap FreeBSD-latest
+      uses: mario-campos/emulate@v1
+      with:
+        operating-system: freebsd-latest
+
+    - name: Install Dependencies
+      run: pkg install -y git
+
+    - name: Build
+      run: |
+        git clone --depth=1 "${{ github.server_url }}/${{ github.repository }}" build
+        cd build
+        [ "${{ github.event.pull_request.number }}" = "" ] || (echo "fetching PR ${{ github.event.pull_request.number }}"; git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} && git checkout "pr-${{ github.event.pull_request.number }}")
+        echo "configure"
+        ./configure --prefix=/usr
+        echo "building"
+        make
+
+  netbsd:
+    runs-on: macos-12
+    steps:
+    - name: Bootstrap NetBSD-latest
+      uses: mario-campos/emulate@v1
+      with:
+        operating-system: netbsd-latest
+
+    - name: Build
+      run: |
+        git clone --depth=1 "${{ github.server_url }}/${{ github.repository }}" build
+        cd build
+        [ "${{ github.event.pull_request.number }}" = "" ] || (echo "fetching PR ${{ github.event.pull_request.number }}"; git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} && git checkout "pr-${{ github.event.pull_request.number }}")
+        echo "configure"
+        ./configure --prefix=/usr
+        echo "building"
+        make