You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2023/01/20 14:09:56 UTC

[openwhisk-utilities] branch master updated: Port CI from Travis to GitHub actions (#87)

This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-utilities.git


The following commit(s) were added to refs/heads/master by this push:
     new 30056e0  Port CI from Travis to GitHub actions (#87)
30056e0 is described below

commit 30056e05c004050b9c465853c8b524e0d8fba810
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Fri Jan 20 09:09:50 2023 -0500

    Port CI from Travis to GitHub actions (#87)
---
 .github/workflows/ci.yaml                | 37 +++++++++++++++++++++++++++++
 .github/workflows/scancode.yaml          | 40 ++++++++++++++++++++++++++++++++
 scancode/action.yaml                     |  5 ++++
 scancode/entrypoint.sh                   |  2 +-
 scancode/{travis.cfg => scancode-ci.cfg} |  0
 scancode/test.sh                         |  4 ++--
 6 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..1301f4b
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: Continuous Integration
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+    types: [ opened, synchronize, reopened ]
+
+jobs:
+  runTests:
+    runs-on: ubuntu-22.04
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+      - name: Setup Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: '3.10'
+      - name: Run ScanCode Tests
+        run: ./scancode/test.sh
diff --git a/.github/workflows/scancode.yaml b/.github/workflows/scancode.yaml
new file mode 100644
index 0000000..a4666ab
--- /dev/null
+++ b/.github/workflows/scancode.yaml
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This overlaps with ci.yaml, but uses the GHA machinery to invoke scanCode
+
+name: Scan Code
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+    types: [ opened, synchronize, reopened ]
+
+jobs:
+  scancode:
+    runs-on: ubuntu-22.04
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+      - name: Scan Code
+        uses: dgrove-oss/openwhisk-utilities/scancode@master
+        with:
+          config: scancode-ci.cfg
+          rootDir: scancode
diff --git a/scancode/action.yaml b/scancode/action.yaml
index 7bbaf42..ac009e0 100644
--- a/scancode/action.yaml
+++ b/scancode/action.yaml
@@ -21,8 +21,13 @@ inputs:
     description: 'Configuration file defining the rules to apply'
     required: false
     default: 'ASF-Release.cfg'
+  rootDir:
+    description: 'Root directory to scan'
+    required: false
+    default: .
 runs:
   using: 'docker'
   image: 'Dockerfile'
   args:
     - ${{ inputs.config }}
+    - ${{ inputs.rootDir }}
diff --git a/scancode/entrypoint.sh b/scancode/entrypoint.sh
index 878b74d..a6a268e 100755
--- a/scancode/entrypoint.sh
+++ b/scancode/entrypoint.sh
@@ -16,4 +16,4 @@
 # limitations under the License.
 #
 
-python3 /scancode/scanCode.py . --config /scancode/$1
+python3 /scancode/scanCode.py --config /scancode/$1 $2
diff --git a/scancode/travis.cfg b/scancode/scancode-ci.cfg
similarity index 100%
rename from scancode/travis.cfg
rename to scancode/scancode-ci.cfg
diff --git a/scancode/test.sh b/scancode/test.sh
index b4c5585..0a49e55 100755
--- a/scancode/test.sh
+++ b/scancode/test.sh
@@ -26,7 +26,7 @@ cd $SCRIPTDIR
 python3 ./scanCode.py . -h
 
 # Test basic usage
-python3 ./scanCode.py . --config travis.cfg
+python3 ./scanCode.py . --config scancode-ci.cfg
 
 # Test verbose usage
-python3 ./scanCode.py . --config travis.cfg -v
+python3 ./scanCode.py . --config scancode-ci.cfg -v