From 509df072be79b3be2a1de6581499e360ab0180be Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 5 Jul 2021 09:32:32 +0200 Subject: [PATCH] Replace Travis CI with Github Actions travis-ci.org is defunct. fd leak test had to be disabled because of https://github.com/actions/runner/issues/1188 . --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ .travis.yml | 22 ---------------------- README.md | 2 +- testsuite_cli_test.go | 7 ++++++- 4 files changed, 33 insertions(+), 24 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 0000000..1123937 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + pull_request: + schedule: + - cron: '0 12 * * *' # Every day noon UTC + +jobs: + build: + runs-on: ubuntu-latest + steps: + + # Looks like Github Actions leaks fds to child processes + # https://github.com/actions/runner/issues/1188 + - run: ls -l /proc/self/fd + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Make "git describe" work + + - run: sudo apt-get install -qq pandoc cppcheck + + - run: make + + - run: make test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2460d61..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -# earlyoom is written in C, but the test suite is written in Go. -# The "go" build environment in Travis CI includes gcc, so just -# pretend we are a Go project. -language: go - -# Travis by default only pulls the last 50 commits, which means -# "git describe" will fail once we are more than 50 commits -# away from the last tag. -git: - depth: 100 - -addons: - apt: - packages: - - pandoc - -script: - - cc --version - - make - - make test - - make format - - git diff diff --git a/README.md b/README.md index 1658489..1f92172 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ earlyoom - The Early OOM Daemon =============================== -[![Build Status](https://api.travis-ci.org/rfjakob/earlyoom.svg)](https://travis-ci.org/rfjakob/earlyoom) +[![CI](https://github.com/rfjakob/earlyoom/actions/workflows/ci.yml/badge.svg)](https://github.com/rfjakob/earlyoom/actions/workflows/ci.yml) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Latest release](https://img.shields.io/github/release/rfjakob/earlyoom.svg)](https://github.com/rfjakob/earlyoom/releases) [![Total alerts](https://img.shields.io/lgtm/alerts/g/rfjakob/earlyoom.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rfjakob/earlyoom/alerts/) diff --git a/testsuite_cli_test.go b/testsuite_cli_test.go index c345680..983ae47 100644 --- a/testsuite_cli_test.go +++ b/testsuite_cli_test.go @@ -4,6 +4,7 @@ import ( "fmt" "io/ioutil" "math" + "os" "strconv" "strings" "testing" @@ -177,7 +178,11 @@ func TestCli(t *testing.T) { pass = false } if res.fds > openFdsMax { - t.Fatalf("High number of open file descriptors: %d", res.fds) + if os.Getenv("GITHUB_ACTIONS") == "true" { + t.Log("Ignoring fd leak. Github Actions bug? See https://github.com/actions/runner/issues/1188") + } else { + t.Fatalf("High number of open file descriptors: %d", res.fds) + } } if !pass { const empty = "(empty)"