Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly setup TravisCI For a simple C project

I'm trying to setup TravisCI to do automated build and tests for me on a C project.

For me to learn and understand it I made a sample github repo to make it work before moving it to my final project.

My Project consists of basically 3 files:

.travis.yml:

language: C

makefile:

hellomake: main.c
    gcc -o hellomake main.c -I.

main.c:

#include <stdio.h>

void main() 
{
    printf("Hello World!");
}

As the project is now I get the following error in Travis:

0.00s$ ./configure && make && make test
/home/travis/build.sh: line 41: ./configure: No such file or directory
The command "./configure && make && make test" exited with 127.

What am I missing or doing wrong?

like image 787
Carsten Farving Avatar asked Oct 26 '15 09:10

Carsten Farving


People also ask

Can I use Travis CI for free?

If you're not familiar with Travis CI, it's a build company that has been powering the continuous integration (CI) of many open source projects since it launched in 2011. It was the first build solution that was free for open source use and that easily integrated into GitHub.

Is Travis CI a CI CD tool?

Travis CI is a commercial CI tool, whereas Jenkins is an open-source tool.

Which of the following file is used to configure the Travis CI?

Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.


1 Answers

According to The Docs the default script for C projects is ./configure && make && make test. However, as specified just a couple of lines below, "This can be overridden as described in the general build configuration guide."

For example, for your project (which only has a Makefile without a test target) you could use:

script: make

For building it (append to .travis.yml).

like image 67
набиячлэвэли Avatar answered Sep 28 '22 05:09

набиячлэвэли