You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2023/01/09 10:13:37 UTC

[couchdb-nano] branch main updated: Removing Travis and replacing with GitHub Workflows (#318)

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

glynnbird pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git


The following commit(s) were added to refs/heads/main by this push:
     new 04eee03  Removing Travis and replacing with GitHub Workflows (#318)
04eee03 is described below

commit 04eee03039758a39af7614e1b72e198c2587bc98
Author: Glynn Bird <gl...@gmail.com>
AuthorDate: Mon Jan 9 10:13:32 2023 +0000

    Removing Travis and replacing with GitHub Workflows (#318)
    
    * first attempt at removing Travis and replacing with GitHub workflows
    
    * remove n option
    
    * persist-credentials: false, as per ASF guidance
    
    Co-authored-by: Glynn Bird <gl...@apache.org>
---
 .github/workflows/ci.yaml         | 37 +++++++++++++++++++++++++++++++++++++
 .travis.yml                       | 16 ----------------
 scripts/run_couchdb_on_travis.sh  | 15 ---------------
 scripts/stop_couchdb_on_travis.sh |  7 -------
 4 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..16dccef
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,37 @@
+name: Nano Automated Testing
+
+on:
+  push:
+    branches: [ main ]
+  pull_request:
+    branches: [ main ]
+
+jobs:
+
+  build:
+    runs-on: ubuntu-latest
+
+    services:
+      couchdb:
+        image: couchdb
+        ports:
+          - 5984:5984
+        env:
+         COUCHDB_USER: admin
+         COUCHDB_PASSWORD: admin
+
+    strategy:
+      matrix:
+        node-version: [14.x, 16.x, 18.x]
+
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          persist-credentials: false
+      - name: Use Node.js ${{ matrix.node-version }}
+        uses: actions/setup-node@v3
+        with:
+          node-version: ${{ matrix.node-version }}
+      - run: npm ci
+      - run: npm run build --if-present
+      - run: TRAVIS=1 npm test
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index a92acf6..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-dist: focal
-language: "node_js"
-node_js:
-  - "14"
-  - "16"
-  - "18"
-services:
-  - docker
-os:
-  - linux
-before_script:
-  - ./scripts/run_couchdb_on_travis.sh
-after_script:
-  - ./scripts/stop_couchdb_on_travis.sh
-before_install:
-  - npm update -g npm
diff --git a/scripts/run_couchdb_on_travis.sh b/scripts/run_couchdb_on_travis.sh
deleted file mode 100755
index eeefa02..0000000
--- a/scripts/run_couchdb_on_travis.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-if [ ! -z $TRAVIS ]; then
-	# Install CouchDB Master
-	echo "Starting CouchDB 3 Docker"
-	docker run --ulimit nofile=2048:2048 -d -p 5984:5984 \
-	    --env COUCHDB_USER=admin --env COUCHDB_PASSWORD=admin \
-	    couchdb --with-haproxy -n 1
-
-	# wait for couchdb to start
-	while [ '200' != $(curl -s -o /dev/null -w %{http_code} http://admin:admin@127.0.0.1:5984/_all_dbs) ]; do
-	  echo waiting for couch to load... ;
-	  sleep 1;
-	done
-fi
\ No newline at end of file
diff --git a/scripts/stop_couchdb_on_travis.sh b/scripts/stop_couchdb_on_travis.sh
deleted file mode 100755
index e1a9049..0000000
--- a/scripts/stop_couchdb_on_travis.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-if [ ! -z $TRAVIS ]; then
-  echo "Stopping CouchDB 3 Docker"
-  docker stop $(docker ps -a -q)
-  docker rm $(docker ps -a -q)
-fi
\ No newline at end of file