aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-12-08 15:03:56 +0100
committerMichael Muré <batolettre@gmail.com>2020-12-08 15:03:56 +0100
commit52ef5e96f543ca242a9e1e8f2917492eb3d3fb95 (patch)
treeeedd06871e39999f08b6be0e7e64e19cb54b096c
parentc884d557bf5e0ebdbe6e3b20535af24c2e97d29f (diff)
downloadgit-bug-52ef5e96f543ca242a9e1e8f2917492eb3d3fb95.tar.gz
add github actions
-rw-r--r--.github/workflows/go.yml41
-rw-r--r--.github/workflows/nodejs.yml38
-rw-r--r--bridge/github/config_test.go3
3 files changed, 82 insertions, 0 deletions
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
new file mode 100644
index 00000000..3ce22f3a
--- /dev/null
+++ b/.github/workflows/go.yml
@@ -0,0 +1,41 @@
+name: Go build and test
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ workflow_dispatch:
+
+jobs:
+ build:
+
+ strategy:
+ matrix:
+ go-version: [1.13.x, 1.14.x, 1.15.x]
+ platform: [ubuntu-latest, macos-latest, windows-latest]
+
+ runs-on: ${{ matrix.platform }}
+
+ steps:
+
+ - name: Set up Go ${{ matrix.node-version }}
+ uses: actions/setup-go@v2
+ with:
+ go-version: ${{ matrix.go-version }}
+
+ - name: Check out code
+ uses: actions/checkout@v2
+
+ - name: Build
+ run: make
+
+ - name: Test
+ run: make test
+ env:
+ GITHUB_TEST_USER: ${{ secrets._GITHUB_TEST_USER }}
+ GITHUB_TOKEN_ADMIN: ${{ secrets._GITHUB_TOKEN_ADMIN }}
+ GITHUB_TOKEN_PRIVATE: ${{ secrets._GITHUB_TOKEN_PRIVATE }}
+ GITHUB_TOKEN_PUBLIC: ${{ secrets._GITHUB_TOKEN_PUBLIC }}
+ GITLAB_API_TOKEN: ${{ secrets.GITLAB_API_TOKEN }}
+ GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }}
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
new file mode 100644
index 00000000..d7a69c8e
--- /dev/null
+++ b/.github/workflows/nodejs.yml
@@ -0,0 +1,38 @@
+name: Node.js build and test
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ workflow_dispatch:
+
+defaults:
+ run:
+ working-directory: webui
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [10.x, 12.x, 14.x]
+
+ steps:
+ - name: Setup Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Check out code
+ uses: actions/checkout@v2
+
+ - name: Install
+ run: make install
+
+ - name: Build
+ run: make build
+
+ - name: Test
+ run: make test
diff --git a/bridge/github/config_test.go b/bridge/github/config_test.go
index eecb1aa8..01907435 100644
--- a/bridge/github/config_test.go
+++ b/bridge/github/config_test.go
@@ -103,6 +103,9 @@ func TestValidateUsername(t *testing.T) {
if env := os.Getenv("TRAVIS"); env == "true" {
t.Skip("Travis environment: avoiding non authenticated requests")
}
+ if _, has := os.LookupEnv("CI"); has {
+ t.Skip("Github action environment: avoiding non authenticated requests")
+ }
tests := []struct {
name string