Browse Source

Issue 4577 - Add GitHub actions

Description:
* Update GH actions to use ubuntu-latest
* Update pytest workflow to also run nightly
* Add SKIP_AUDIT_CI=1 to copr builds
* Add npm audit-ci workflow
* Add badges with test status to README.md

Relates: https://github.com/389ds/389-ds-base/issues/4577
Relates: https://github.com/389ds/389-ds-base/issues/4901

Reviewed by: mreynolds (Thanks!)
Viktor Ashirov 4 years ago
parent
commit
0d907a97ee
5 changed files with 41 additions and 14 deletions
  1. 1 1
      .copr/Makefile
  2. 10 10
      .github/workflows/compile.yml
  3. 20 0
      .github/workflows/npm.yml
  4. 7 3
      .github/workflows/pytest.yml
  5. 3 0
      README.md

+ 1 - 1
.copr/Makefile

@@ -5,7 +5,7 @@ srpm:
 	dnf install -y dnf-plugins-core
 	dnf install -y dnf-plugins-core
 	dnf builddep -y --skip-broken --spec rpmbuild/SPECS/389-ds-base.spec --best --allowerasing --setopt=install_weak_deps=False
 	dnf builddep -y --skip-broken --spec rpmbuild/SPECS/389-ds-base.spec --best --allowerasing --setopt=install_weak_deps=False
 	# Generate srpm
 	# Generate srpm
-	make -f rpm.mk srpms
+	SKIP_AUDIT_CI=1 make -f rpm.mk srpms
 	
 	
 	if [[ "${outdir}" != "" ]]; then \
 	if [[ "${outdir}" != "" ]]; then \
 	        mv dist/srpms/* ${outdir}; \
 	        mv dist/srpms/* ${outdir}; \

+ 10 - 10
.github/workflows/compile.yml

@@ -10,20 +10,20 @@ jobs:
       fail-fast: false
       fail-fast: false
       matrix:
       matrix:
         name:
         name:
-          - Fedora 33 GCC
-          - Fedora 33 GCC Strict
-          - Fedora 33 GCC Static Analyzer
-          - Fedora 33 Clang
-          - Fedora 33 Clang -Weverything
+          - GCC
+          - GCC Strict
+          - GCC Static Analyzer
+          - Clang
+          - Clang -Weverything
 
 
         include:
         include:
-          - name: Fedora 33 GCC
+          - name: GCC
             image: quay.io/389ds/ci-images:fedora
             image: quay.io/389ds/ci-images:fedora
             compiler: gcc
             compiler: gcc
             cpp-compiler: g++
             cpp-compiler: g++
             cflags:  "-O2 -g"
             cflags:  "-O2 -g"
 
 
-          - name: Fedora 33 GCC strict
+          - name: GCC strict
             image: quay.io/389ds/ci-images:fedora
             image: quay.io/389ds/ci-images:fedora
             compiler: gcc
             compiler: gcc
             cpp-compiler: g++
             cpp-compiler: g++
@@ -31,19 +31,19 @@ jobs:
             -Wstrict-prototypes -Wstrict-overflow=5 -Wwrite-strings -Winit-self \
             -Wstrict-prototypes -Wstrict-overflow=5 -Wwrite-strings -Winit-self \
             -Wuninitialized -Wno-sign-compare -Wshadow -Wformat-security"
             -Wuninitialized -Wno-sign-compare -Wshadow -Wformat-security"
 
 
-          - name: Fedora 33 GCC Static Analyzer
+          - name: GCC Static Analyzer
             image: quay.io/389ds/ci-images:fedora
             image: quay.io/389ds/ci-images:fedora
             compiler: gcc
             compiler: gcc
             cpp-compiler: g++
             cpp-compiler: g++
             cflags:  "-O2 -g -fanalyzer"
             cflags:  "-O2 -g -fanalyzer"
 
 
-          - name: Fedora 33 Clang
+          - name: Clang
             image: quay.io/389ds/ci-images:fedora
             image: quay.io/389ds/ci-images:fedora
             compiler: clang
             compiler: clang
             cpp-compiler: clang++
             cpp-compiler: clang++
             cflags: "-O2 -g -Qunused-arguments"
             cflags: "-O2 -g -Qunused-arguments"
 
 
-          - name: Fedora 33 Clang -Weverything
+          - name: Clang -Weverything
             image: quay.io/389ds/ci-images:fedora
             image: quay.io/389ds/ci-images:fedora
             compiler: clang
             compiler: clang
             cpp-compiler: clang++
             cpp-compiler: clang++

+ 20 - 0
.github/workflows/npm.yml

@@ -0,0 +1,20 @@
+name: npm-audit-ci
+
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron:  '0 0 * * *'
+
+jobs:
+  npm-audit-ci:
+    name: npm-audit-ci
+    runs-on: ubuntu-latest
+    container:
+      image: quay.io/389ds/ci-images:test
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: Run NPM Audit CI
+        run: cd $GITHUB_WORKSPACE/src/cockpit/389-console && npx audit-ci --config audit-ci.json

+ 7 - 3
.github/workflows/pytest.yml

@@ -1,11 +1,15 @@
 name: Test
 name: Test
 
 
-on: [push, pull_request]
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron:  '0 0 * * *'
 
 
 jobs:
 jobs:
   build:
   build:
     name: Build
     name: Build
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-latest
     container:
     container:
       image: quay.io/389ds/ci-images:test
       image: quay.io/389ds/ci-images:test
     outputs:
     outputs:
@@ -32,7 +36,7 @@ jobs:
 
 
   test:
   test:
     name: Test
     name: Test
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-latest
     needs: build
     needs: build
     strategy:
     strategy:
       fail-fast: false
       fail-fast: false

+ 3 - 0
README.md

@@ -1,6 +1,9 @@
 389 Directory Server
 389 Directory Server
 ====================
 ====================
 
 
+[![Test](https://github.com/389ds/389-ds-base/actions/workflows/pytest.yml/badge.svg)](https://github.com/389ds/389-ds-base/actions/workflows/pytest.yml)
+[![npm-audit-ci](https://github.com/389ds/389-ds-base/actions/workflows/npm.yml/badge.svg)](https://github.com/389ds/389-ds-base/actions/workflows/npm.yml)
+
 389 Directory Server is a highly usable, fully featured, reliable
 389 Directory Server is a highly usable, fully featured, reliable
 and secure LDAP server implementation. It handles many of the
 and secure LDAP server implementation. It handles many of the
 largest LDAP deployments in the world.
 largest LDAP deployments in the world.