From 69b2c470899aa4e6ef332bec3888704d5c083f68 Mon Sep 17 00:00:00 2001 From: ooxi Date: Fri, 19 Nov 2021 17:50:15 +0100 Subject: [PATCH] Switch from Travis CI to GitHub Actions While Travis CI has served us well in the past, the recent changes made it unusable. Farewell Travis CI! --- .github/workflows/ci.yaml | 24 ++++++++++++++++++++++++ .mc/rebuild.sh | 21 +++++++++++++++++++++ mc.yaml => .mc/ubuntu:16.04.yaml | 0 .travis.yml | 14 -------------- README.md | 2 +- 5 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci.yaml create mode 100755 .mc/rebuild.sh rename mc.yaml => .mc/ubuntu:16.04.yaml (100%) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..998e3f5 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,24 @@ +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull +# request events but only for the main branch +on: + push: + branches: + - master + pull_request: + branches: [ master ] + schedule: + - cron: '0 0 15 * *' + + +jobs: + ci: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Build and TesT + run: npx --package mini-cross@0.15.2 mc --no-tty ubuntu:16.04 .mc/rebuild.sh + diff --git a/.mc/rebuild.sh b/.mc/rebuild.sh new file mode 100755 index 0000000..67443c3 --- /dev/null +++ b/.mc/rebuild.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + + +# @see https://stackoverflow.com/a/1482133 +DIRECTORY_OF_SCRIPT=`dirname "$(readlink -f "$0")"` + +SOURCE_DIRECTORY="${DIRECTORY_OF_SCRIPT}/.." +BUILD_DIRECTORY="${DIRECTORY_OF_SCRIPT}/../build" + + +if [ -d "${BUILD_DIRECTORY}" ]; then + rm -rf "${BUILD_DIRECTORY}" +fi +mkdir "${BUILD_DIRECTORY}" + +(cd "${BUILD_DIRECTORY}" && cmake -DCMAKE_BUILD_TYPE=Release ..) +make --directory "${BUILD_DIRECTORY}" --silent +make --directory "${BUILD_DIRECTORY}" --silent test + diff --git a/mc.yaml b/.mc/ubuntu:16.04.yaml similarity index 100% rename from mc.yaml rename to .mc/ubuntu:16.04.yaml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9a63393..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: c -compiler: - - gcc - - g++ -before_install: - - sudo apt-get update - - sudo apt-get install cmake valgrind -script: - - mkdir build && cd build - - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DXML_PARSER_VERBOSE=On .. - - make -after_script: - - make test - diff --git a/README.md b/README.md index a30489d..cc6bfe0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ which also just parses an xml subset, [xml.c](https://github.com/ooxi/xml.c) is a simple, small and self contained xml parser in one file. Ideal for embedding into other projects without the need for big external dependencies. -[![Build Status](https://secure.travis-ci.org/ooxi/xml.c.png)](http://travis-ci.org/ooxi/xml.c) +[![Build Status](https://github.com/ooxi/xml.c/actions/workflows/ci.yaml/badge.svg)](https://github.com/ooxi/xml.c/actions) Downloads