diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..8459f200f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI +on: + push: + branches: + - develop + - next-minor + - main + - master + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: + - 2.6 + - 2.5 + db: + - mysql + - postgresql + kind: + - cucumber + - other + env: + DB: ${{ matrix.db }} + RAILS_ENV: test + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: Install system dependencies + run: sudo apt-get install -y libidn11-dev + - name: Start MySQL + run: sudo systemctl start mysql.service + if: matrix.db == 'mysql' + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Prepare + run: script/ci/prepare.sh + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: vendor/bundle + key: bundler-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.db }}-${{ hashFiles('Gemfile.lock') }} + - name: Install dependencies + run: bundle + - name: Run tests + run: bin/rake --trace ci:${{ matrix.kind }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f3b0fd484..000000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -language: ruby - -rvm: - - 2.6.6 - - 2.5.8 - -env: - - DB=postgresql BUILD_TYPE=cucumber - - DB=mysql BUILD_TYPE=cucumber - - DB=postgresql BUILD_TYPE=other - - DB=mysql BUILD_TYPE=other - -sudo: false -cache: - bundler: true - directories: - - app/assets/images - - tmp/cache/assets - -addons: - apt: - packages: - - libidn11-dev - - ghostscript - -services: - - postgresql - - mysql - -branches: - only: - - 'master' - - 'next-minor' - - 'develop' - -before_install: - - script/ci/prepare.sh - - mkdir travis-phantomjs - - wget http://cifiles.diasporafoundation.org/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 - - tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs - - export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - -script: "bin/rake --trace ci:travis:${BUILD_TYPE}" - -notifications: - irc: - channels: - - secure: YvYkeTAw+5oOl/RaXVwu7JkKGNWPoFosNQRmLvJkBFbWzZ1s5LZD1u3+Qj819bT3lGzJu9pxmJg765IRYrGWmBi4mcAV3dpO6qowVdFTcorf0JsnLw3Kvkga9rrDunsRNr21KTAQqHOO5mKUzw9DtMzd52BiWuZwIj3xcl72gQI= - template: - - "%{repository_slug}#%{commit} (%{branch} - %{commit_subject}): %{message} %{build_url}" diff --git a/README.md b/README.md index 7346700b7..8d7ef8029 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # diaspora\* ### A privacy-aware, distributed, open source social network -**master:** [![Build Status master](https://secure.travis-ci.org/diaspora/diaspora.svg?branch=master)](http://travis-ci.org/diaspora/diaspora) -**next-minor:** [![Build Status next-minor](https://secure.travis-ci.org/diaspora/diaspora.svg?branch=next-minor)](http://travis-ci.org/diaspora/diaspora) [![Coverage Status next-minor](https://coveralls.io/repos/github/diaspora/diaspora/badge.svg?branch=next-minor)](https://coveralls.io/github/diaspora/diaspora?branch=next-minor)| **develop:** [![Build Status develop](https://secure.travis-ci.org/diaspora/diaspora.svg?branch=develop)](http://travis-ci.org/diaspora/diaspora) [![Coverage Status develop](https://coveralls.io/repos/github/diaspora/diaspora/badge.svg?branch=develop)](https://coveralls.io/github/diaspora/diaspora?branch=develop) | diff --git a/config/database.yml.example b/config/database.yml.example index 31d608332..f71f860ab 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -3,7 +3,7 @@ postgresql: &postgresql host: "localhost" port: 5432 username: "postgres" - password: "" + password: "postgres" encoding: unicode mysql: &mysql @@ -11,7 +11,7 @@ mysql: &mysql host: "localhost" port: 3306 username: "root" - password: "" + password: "root" # socket: /tmp/mysql.sock encoding: utf8mb4 collation: utf8mb4_bin @@ -31,6 +31,7 @@ common: &common #### CONFIGURE ABOVE ############################# ################################################## + # Normally you don't need to touch anything here combined: &combined diff --git a/lib/tasks/tests.rake b/lib/tasks/tests.rake index 30c0eec48..666c9e52d 100644 --- a/lib/tasks/tests.rake +++ b/lib/tasks/tests.rake @@ -1,16 +1,14 @@ # frozen_string_literal: true namespace :ci do - namespace :travis do - task prepare_db: %w[db:create db:migrate] - task prepare: %w[prepare_db assets:generate_error_pages] + task prepare_db: %w[db:create db:migrate] + task prepare: %w[prepare_db assets:generate_error_pages] - desc "Run everyhting except cucumber" - task other: %w[prepare tests:generate_fixtures spec jasmine:ci] + desc "Run everyhting except cucumber" + task other: %w[prepare tests:generate_fixtures spec jasmine:ci] - desc "Run cucumber" - task cucumber: %w[prepare rake:cucumber] - end + desc "Run cucumber" + task cucumber: %w[prepare rake:cucumber] end if defined?(RSpec)