From fe50f5444c2fbf57f61b6fc3a74b5779b7562cb5 Mon Sep 17 00:00:00 2001 From: Sung Date: Sun, 5 Feb 2023 11:26:09 +1100 Subject: [PATCH 1/2] Run CI --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 32 --------------------------- pkg/server/.env.test | 2 +- 3 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..99008f06 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: Test +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-22.04 + + services: + postgres: + image: postgres:14 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: dnote_test + POSTGRES_PORT: 5432 + # Wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + # Expose port to the host + ports: + - 5432:5432 + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '1.20.0' + + - name: Install dependencies + run: | + make install + + - name: Test cli + run: | + make test-cli + + - name: Test app + run: | + make test-api diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 529b7bae..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: go -dist: xenial - -go: - - 1.13 - -env: - - NODE_VERSION=10.15.0 - -before_install: - - sudo apt-get update - - sudo apt-get --yes remove postgresql\* - - sudo apt-get install -y postgresql-11 postgresql-client-11 - - sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf - - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/11/main/postgresql.conf - - sudo service postgresql restart 11 - -before_script: - - nvm install "$NODE_VERSION" - - nvm use "$NODE_VERSION" - - node --version - - psql -c "CREATE DATABASE dnote_test;" -U postgres - -install: - - make install - -script: - - make lint - - make test-cli - - make test-api - - make test-web - - make test-jslib diff --git a/pkg/server/.env.test b/pkg/server/.env.test index 6a5b9ffe..a1568432 100644 --- a/pkg/server/.env.test +++ b/pkg/server/.env.test @@ -4,7 +4,7 @@ DBHost=localhost DBPort=5432 DBName=dnote_test DBUser=postgres -DBPassword= +DBPassword=postgres DBSkipSSL=true SmtpUsername=mock-SmtpUsername From 4e1e74bf5ef38f8c6f2b4e0ce025b22123650e1e Mon Sep 17 00:00:00 2001 From: Sung Date: Sun, 5 Feb 2023 12:31:13 +1100 Subject: [PATCH 2/2] Fix build status in README --- .github/workflows/ci.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99008f06..50f08124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test +name: CI on: push: branches: [master] diff --git a/README.md b/README.md index 34dea743..e458b9f7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ ![Dnote](assets/logo.png) ========================= -[![Build Status](https://travis-ci.org/dnote/dnote.svg?branch=master)](https://travis-ci.org/dnote/dnote) +![Build Status](https://github.com/dnote/dnote/actions/workflows/ci.yml/badge.svg) Dnote is a simple command line notebook for programmers. -It **keeps you focused** by providing a way of effortlessly capturing and retrieving information **without leaving your terminal**. It also offers a seamless **multi-device sync** and a **web interface**. +It **keeps you focused** by providing a way of effortlessly capturing and retrieving information **without leaving your terminal**. It also offers a seamless **multi-device sync**. ![A demo of Dnote command line interface](assets/cli.gif "Dnote command line interface")