diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..50f08124 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI +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/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") 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