Migrate from travis-ci.org to GitHub actions.

It looks like travis-ci.org is going away. From
https://docs.travis-ci.com/user/migrate/open-source-repository-migration/#frequently-asked-questions
Q. What will happen to travis-ci.org after December 31st, 2020?
A. Travis-ci.org will be switched to a read-only platform, allowing you to
see your jobs build history from all repositories previously connected to
travis-ci.org.

Migrate the CI job to GitHub actions.

See hrm Task #902085
This commit is contained in:
Sveinung Kvilhaugsvik
2020-12-03 10:57:21 +01:00
parent e1bcca38a5
commit 59933070f9
8 changed files with 37 additions and 28 deletions

View File

@@ -2,7 +2,6 @@
.gitattributes
.gitignore
.mailmap
.travis.yml
ADVANCED.md
CONTRIBUTING.md
Dockerfile

26
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: continuous integration
on:
- pull_request
- push
- workflow_dispatch
jobs:
normal:
runs-on: ubuntu-18.04
steps:
- name: check out Freeciv-web
uses: actions/checkout@v2
- name: prepare
run: |
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
ip addr # for confirmation. can be skipped
sudo apt-get remove ^postgresql 'mysql.*'
sudo rm -rf /var/lib/mysql
- name: install
shell: bash
run: ./scripts/install/install.sh --mode=TEST
- name: run tests
shell: bash
run: ./scripts/ci-run.sh

View File

@@ -1,16 +0,0 @@
sudo: required
dist: bionic
language: c
compiler:
- gcc
script: ./scripts/install/install.sh --mode=TEST && ./scripts/travis-run.sh
before_install:
- sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
- sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
- ip addr # for confirmation. can be skipped
- sudo apt-get remove ^postgresql 'mysql.*'
- sudo rm -rf /var/lib/mysql

View File

@@ -20,7 +20,7 @@ We will get a better Freeciv-web service if we allow multiple servers to exists
- All changes to Freeciv-web must be done using Pull Requests on GitHub. Don't commit changes directly to the master or develop branch.
- Pull requests must be approved by two other Freeciv developers. Minor changes can be approved by one Freeciv developer. If there's no objections within 72h to the pull request, it's ok to merge it.
- Only freeciv maintainers team members have rights to merge commits.
- Don't break the build. All tests run by Travis CI must pass successfully.
- Don't break the build. All tests run by GitHub actions must pass successfully.
- The repository github.com/freeciv/freeciv-web should be generic, not specific to one particular Freeciv-web server instance or Freeciv-web fork.
- Try not to exceed 200 LOC +- in a single PR. Larger pull-requests are allowed when required.
- Avoid whitespace-only or other trivial changes that do not change logic.

View File

@@ -1,7 +1,7 @@
THE FREECIV-WEB PROJECT
-----------------------
[![Build Status](https://api.travis-ci.org/freeciv/freeciv-web.png)](https://travis-ci.org/freeciv/freeciv-web)
[![Build Status](https://github.com/freeciv/freeciv-web/workflows/continuous%20integration/badge.svg)](https://github.com/freeciv/freeciv-web/actions?query=workflow%3A%22continuous+integration%22)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/freeciv/freeciv-web.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/freeciv/freeciv-web/context:javascript)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/freeciv/freeciv-web.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/freeciv/freeciv-web/alerts)
@@ -190,11 +190,11 @@ http://localhost/
Enjoy. The overall dockerfile and required changes to scripts needs some further improvements.
Freeciv-Web continuous integration on Travis CI
-----------------------------------------------
Freeciv-Web is built on Travis CI on every commit. This is the current build status: [![Build Status](https://api.travis-ci.org/freeciv/freeciv-web.png)](https://travis-ci.org/freeciv/freeciv-web)
Freeciv-Web continuous integration on GitHub actions
----------------------------------------------------
Freeciv-Web is built on GitHub actions on every commit. This is the current build status: [![Build Status](https://github.com/freeciv/freeciv-web/workflows/continuous%20integration/badge.svg)](https://github.com/freeciv/freeciv-web/actions?query=workflow%3A%22continuous+integration%22)
Freeciv-web has CasperJS tests which are run by Travis CI on every commit, and by Vagrant when creating a new image. The tests can be found in tests/freeciv-web-tests.js. Please make sure that patches and commits for Freeciv-web don't break the CasperJS tests. Thanks!
Freeciv-web has CasperJS tests which are run by GitHub actions on every commit, and by Vagrant when creating a new image. The tests can be found in tests/freeciv-web-tests.js. Please make sure that patches and commits for Freeciv-web don't break the CasperJS tests. Thanks!
Developers interested in Freeciv-web
------------------------------------

View File

@@ -14,7 +14,7 @@ DB_PASSWORD=changeme
# This is the DB manager superuser password.
# Leave it blank to be asked for it when needed.
# The default value is random, which is OK only if you will never mess
# with the DB manager (in a dedicated vm for tests, like the travis install,
# with the DB manager (in a dedicated vm for tests, like the CI install,
# for example), as reading the config again will give another value,
# so it won't be the correct one for this variable, and you are not notified
# of the first one.

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# Freeciv-web Travis CI test script
# Freeciv-web CI test script
error=0

View File

@@ -1,7 +1,7 @@
CasperJS tests for Freeciv-web.
===============================
This test is run automatically when setting up Vagrant or TravisCI installation.
This test is run automatically when setting up Vagrant or GitHub actions installation.
Freeciv-web requires CasperJS 1.1.2, PhantomJS 2.0 or SlimerJS version 0.10.0pre,
and xvfb (for headless tests).
@@ -13,6 +13,6 @@
```
Running the tests will also produce two screenshots.
The automatic build by Travis-CI uses PhantomJS.
The automatic build by GitHub actions uses PhantomJS.
freeciv-web-autogame.js will start a server autogame for 200 turns. This is run by Travis-CI also.
freeciv-web-autogame.js will start a server autogame for 200 turns. This is run by GitHub actions also.