]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
Switch to Github Actions
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 17 Mar 2021 21:24:32 +0000 (17:24 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 26 Apr 2021 15:54:25 +0000 (11:54 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
.github/workflows/coverity.yml [new file with mode: 0644]
.github/workflows/test.yml [new file with mode: 0644]
.travis.yml [deleted file]

diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644 (file)
index 0000000..218e951
--- /dev/null
@@ -0,0 +1,52 @@
+name: Coverity
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Download Coverity Build Tool
+        run: |
+          wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=lxc/lxcfs" -O cov-analysis-linux64.tar.gz
+          mkdir cov-analysis-linux64
+          tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
+        env:
+          TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
+
+      - name: Install dependencies
+        run: |
+          sudo apt-get update -qq
+          sudo apt-get install -qq gcc clang
+          sudo apt-get install -qq libfuse-dev uuid-runtime
+
+      - name: Run coverity
+        run: |
+          export PATH="$(pwd)/cov-analysis-linux64/bin:${PATH}"
+
+          # Configure
+          ./bootstrap.sh
+          mkdir build
+          cd build
+          ../configure --prefix=/usr
+
+          # Build
+          cov-build --dir cov-int make -j4
+          tar czvf lxcfs.tgz cov-int
+
+          # Submit the results
+          curl \
+            --form project=lxc/lxcfs \
+            --form token=${TOKEN} \
+            --form email=lxc-devel@lists.linuxcontainers.org \
+            --form file=@lxcfs.tgz \
+            --form version=master \
+            --form description="${GITHUB_SHA}" \
+            https://scan.coverity.com/builds?project=lxc/lxcfs
+        env:
+          TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..aa5bced
--- /dev/null
@@ -0,0 +1,55 @@
+name: Build and test
+on:
+  - push
+  - pull_request
+
+jobs:
+  test:
+    strategy:
+      fail-fast: false
+      matrix:
+        compiler:
+          - gcc
+          - clang
+        os:
+          - ubuntu-16.04
+          - ubuntu-18.04
+          - ubuntu-20.04
+        exclude:
+          - os: ubuntu-16.04
+            compiler: gcc
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Install dependencies
+        run: |
+          sudo apt-get update -qq
+          sudo apt-get install -qq gcc clang
+          sudo apt-get install -qq libfuse-dev uuid-runtime
+
+      - name: Compiler version
+        env:
+          CC: ${{ matrix.compiler }}
+        run: |
+          ${CC} --version
+
+      - name: Build
+        env:
+          CC: ${{ matrix.compiler }}
+        run: |
+          # Configure
+          ./bootstrap.sh
+          CFLAGS='-g -O0 -std=c11 -DDEBUG -DVERBOSE -DRESOLVE_NOW -Wall -Werror' ./configure --prefix=/usr
+
+          # Build
+          make -j4
+          (cd tests && make tests)
+
+      - name: Test
+        env:
+          CC: ${{ matrix.compiler }}
+        run: |
+          echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true
+          sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" tests/main.sh
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 234edb2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-dist: bionic
-sudo: required
-language: c
-
-compiler:
- - gcc
- - clang
-
-arch:
- - amd64
- - arm64
- - ppc64le
- - s390x
-
-env:
- global:
-   - secure: "git3Pry4fHtyXFNdy+b5NjIxHOkg1olPKCqKXc0SD9FLBF6oxmvrt8QXDoPWolLK6Y62GEu751tWXJ8YsYAkPMlNX3lrfyxomhmhKCB1pHQvnZ/ln15Na3EGG9HvpKs2VTqc1s5817rfo+USUwGmbeNqe99BI3egNG1o/WiKiOQ="
-
-before_install:
- - sudo apt-get update -qq
- - sudo apt-get -y install -qq automake coreutils libfuse-dev libtool uuid-runtime
-
-script:
- - ./bootstrap.sh
- - CFLAGS='-g -O0 -std=c11 -DDEBUG -DVERBOSE -DRESOLVE_NOW -Wall -Werror' ./configure --prefix=/usr
- - make -j4
- - (cd tests && make tests)
- - echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true
- - sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" tests/main.sh
-
-notifications:
-  email:
-    recipients:
-      - serge.hallyn@ubuntu.com
-      - stgraber@ubuntu.com
-
-addons:
-  coverity_scan:
-    build_script_url: https://dl.stgraber.org/coverity_travis.sh
-    project:
-      name: lxc/lxcfs
-      description: "FUSE filesystem for LXC https://linuxcontainers.org/lxcfs"
-
-    # Where email notification of build analysis results will be sent
-    notification_email: christian.brauner@ubuntu.com
-
-    build_command_prepend: "./bootstrap.sh && mkdir build && cd build && ../configure --prefix=/usr"
-    build_command: "make -j4"
-    branch_pattern: master