aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2019-09-15 11:32:12 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2019-09-15 11:48:15 -0700
commit934385ff5535ee32a90d95411f99db933ad805a8 (patch)
treeed0af96aa1c0e13e2dd6a41e489bd196849a6195
parentfb9a1a61297a8f1882d27067f69d84d46c8286e7 (diff)
Replace Travis by GitHub Actions
-rw-r--r--.github/workflows/ci.yml95
-rw-r--r--.travis.yml20
-rw-r--r--README.md1
-rw-r--r--reader/json/parser_test.go3
4 files changed, 97 insertions, 22 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..de999ef
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,95 @@
+name: CI Workflow
+on:
+ pull_request:
+ branches:
+ - master
+
+jobs:
+
+ linters:
+ name: Linter Check
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Go
+ uses: actions/setup-go@v1
+ with:
+ go-version: 1.13
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Checkout
+ uses: actions/checkout@v1
+ with:
+ fetch-depth: 3
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Install linters
+ run: |
+ cd /tmp && go get -u golang.org/x/lint/golint
+ sudo npm install -g jshint
+ env:
+ GO111MODULE: off
+ - name: Run golint
+ run: |
+ export PATH=/home/runner/go/bin:$PATH
+ make lint
+ - name: Run jshint
+ run: jshint ui/static/js/*.js
+
+ unit-tests:
+ name: Unit Tests
+ runs-on: ${{ matrix.os }}
+ strategy:
+ max-parallel: 4
+ matrix:
+ os: [ubuntu-latest, windows-latest, macOS-latest]
+ go-version: [1.11, 1.12, 1.13]
+ steps:
+ - name: Set up Go
+ uses: actions/setup-go@v1
+ with:
+ go-version: ${{ matrix.go-version }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Checkout
+ uses: actions/checkout@v1
+ with:
+ fetch-depth: 3
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Run unit tests
+ run: make test
+
+ integration-tests:
+ name: Integration Tests
+ runs-on: ubuntu-latest
+ services:
+ postgres:
+ image: postgres:9.5
+ env:
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_DB: postgres
+ ports:
+ - 5432:5432
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
+ steps:
+ - name: Set up Go
+ uses: actions/setup-go@v1
+ with:
+ go-version: 1.13
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Checkout
+ uses: actions/checkout@v1
+ with:
+ fetch-depth: 3
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Install Postgres client
+ run: sudo apt-get install -y postgresql-client
+ - name: Run integration tests
+ run: make integration-test
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PGHOST: 127.0.0.1
+ PGPASSWORD: postgres
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 03f6f0e..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-notifications:
- email: false
-services:
- - postgresql
-addons:
- postgresql: "9.4"
-language: go
-go_import_path: "miniflux.app"
-go:
- - "1.11"
- - "1.12"
- - "1.13"
-before_install:
- - npm install -g jshint
- - go get -u golang.org/x/lint/golint
-script:
- - jshint ui/static/js/*.js
- - make lint
- - make test
- - make integration-test
diff --git a/README.md b/README.md
index b81ad4c..21bf574 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
Miniflux 2
==========
-[![Build Status](https://travis-ci.org/miniflux/miniflux.svg?branch=master)](https://travis-ci.org/miniflux/miniflux)
[![GoDoc](https://godoc.org/miniflux.app?status.svg)](https://godoc.org/miniflux.app)
Miniflux is a minimalist and opinionated feed reader:
diff --git a/reader/json/parser_test.go b/reader/json/parser_test.go
index 482212b..d55eb92 100644
--- a/reader/json/parser_test.go
+++ b/reader/json/parser_test.go
@@ -283,7 +283,8 @@ func TestParseFeedItemWithInvalidDate(t *testing.T) {
t.Errorf("Incorrect number of entries, got: %d", len(feed.Entries))
}
- if !feed.Entries[0].Date.Before(time.Now()) {
+ duration := time.Since(feed.Entries[0].Date)
+ if duration.Seconds() > 1 {
t.Errorf("Incorrect entry date, got: %v", feed.Entries[0].Date)
}
}