From 12fd8cfe8b8937681cc839867f7da7f8c1c8ecf9 Mon Sep 17 00:00:00 2001
From: George Fleury <gfleury@gmail.com>
Date: Wed, 30 Aug 2023 10:09:28 +0200
Subject: [PATCH] Enable github actions

---
 .github/workflows/pr.yaml | 27 ++++++++++++++++++++
 .swagger-codegen-ignore   | 23 -----------------
 .swagger-codegen/VERSION  |  1 -
 .travis.yml               | 26 --------------------
 git_push.sh               | 52 ---------------------------------------
 5 files changed, 27 insertions(+), 102 deletions(-)
 create mode 100644 .github/workflows/pr.yaml
 delete mode 100644 .swagger-codegen-ignore
 delete mode 100644 .swagger-codegen/VERSION
 delete mode 100644 .travis.yml
 delete mode 100644 git_push.sh

diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
new file mode 100644
index 0000000..afb44a2
--- /dev/null
+++ b/.github/workflows/pr.yaml
@@ -0,0 +1,27 @@
+name: Go
+
+on: [push]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go-version: [ '1.21.x', 'stable' ]
+
+    steps:
+      - uses: actions/checkout@v3
+      - name: Setup Go ${{ matrix.go-version }}
+        uses: actions/setup-go@v4
+        with:
+          go-version: ${{ matrix.go-version }}
+
+      - name: Display Go version
+        run: go version
+
+      - name: Build
+        run: go build -v ./...
+
+      - name: Test
+        run: go test -v ./...
diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore
deleted file mode 100644
index c5fa491..0000000
--- a/.swagger-codegen-ignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Swagger Codegen Ignore
-# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
-
-# Use this file to prevent files from being overwritten by the generator.
-# The patterns follow closely to .gitignore or .dockerignore.
-
-# As an example, the C# client generator defines ApiClient.cs.
-# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
-#ApiClient.cs
-
-# You can match any string of characters against a directory, file or extension with a single asterisk (*):
-#foo/*/qux
-# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
-
-# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
-#foo/**/qux
-# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
-
-# You can also negate patterns with an exclamation (!).
-# For example, you can ignore all files in a docs folder with the file extension .md:
-#docs/*.md
-# Then explicitly reverse the ignore rule for a single file:
-#!docs/README.md
diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION
deleted file mode 100644
index cc6612c..0000000
--- a/.swagger-codegen/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.3.0
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 7541030..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-language: go
-go:
-  - 1.11.x
-  - 1.13.x
-  - 1.14.x
-  - master
-env:
-  - GO111MODULE=on
-    GOLANGCI_LINT_VERSION=1.35.2
-
-services:
-  - docker
-
-before_install:
-  - docker pull gfleury/bb-demo:demo
-  - docker run -e BITBUCKET_HOME=/mnt --rm --name="bitbucket" -d -p 7990:7990 -p 7999:7999 gfleury/bb-demo:demo
-  - docker ps -a
-  - curl http://localhost:7990/mvc/login?nextUrl=/dashboard |grep "Log in"; while [ $? != 0 ]; do sleep 2; curl http://localhost:7990/mvc/login?nextUrl=/dashboard |grep "Log in"; done
-
-script:
-  - go test -coverprofile=coverage.txt -covermode=atomic
-  - INTEGRATION=TRUE go test
-  - go build -v ./
-  - if [[ "$(go version)" =~ "go version go1.11" ]]; then exit 0; else curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin "v${GOLANGCI_LINT_VERSION}" && golangci-lint run -v; fi
-after_success:
-  - bash <(curl -s https://codecov.io/bash)
diff --git a/git_push.sh b/git_push.sh
deleted file mode 100644
index ae01b18..0000000
--- a/git_push.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
-#
-# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
-
-git_user_id=$1
-git_repo_id=$2
-release_note=$3
-
-if [ "$git_user_id" = "" ]; then
-    git_user_id="GIT_USER_ID"
-    echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
-fi
-
-if [ "$git_repo_id" = "" ]; then
-    git_repo_id="GIT_REPO_ID"
-    echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
-fi
-
-if [ "$release_note" = "" ]; then
-    release_note="Minor update"
-    echo "[INFO] No command line input provided. Set \$release_note to $release_note"
-fi
-
-# Initialize the local directory as a Git repository
-git init
-
-# Adds the files in the local repository and stages them for commit.
-git add .
-
-# Commits the tracked changes and prepares them to be pushed to a remote repository. 
-git commit -m "$release_note"
-
-# Sets the new remote
-git_remote=`git remote`
-if [ "$git_remote" = "" ]; then # git remote not defined
-
-    if [ "$GIT_TOKEN" = "" ]; then
-        echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
-        git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
-    else
-        git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
-    fi
-
-fi
-
-git pull origin master
-
-# Pushes (Forces) the changes in the local repository up to the remote repository
-echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
-git push origin master 2>&1 | grep -v 'To https'
-