Adding a new repository to travis
To add a new repository to Travis CI, you'll need to follow these steps:
Step 1: Create a .travis.yml
file
In the root directory of your repository, create a new file named .travis.yml
. This file contains the configuration settings for your Travis CI build.
Step 2: Configure your .travis.yml
file
In the .travis.yml
file, you'll need to specify the following:
language
: The programming language used in your repository (e.g.,python
,java
,ruby
, etc.).script
: The command(s) to run during the build process.branches
: The branch(es) you want to build (e.g.,master
,develop
, etc.).
Here's an example .travis.yml
file:
language: python
script: python -m unittest discover
branches:
only:
- master
This configuration tells Travis CI to:
- Use Python as the programming language.
- Run the
unittest
command to discover and run tests. - Only build the
master
branch.
Step 3: Add your repository to Travis CI
Go to the Travis CI website and sign in with your GitHub account. Click on the "Add Repository" button and enter the following information:
- Repository owner: Your GitHub username or organization.
- Repository name: The name of your repository.
- Branch: The branch you want to build (e.g.,
master
).
Click the "Add Repository" button to add your repository to Travis CI.
Step 4: Verify your configuration
After adding your repository, Travis CI will automatically detect the .travis.yml
file and start building your repository. You can verify that your configuration is correct by checking the Travis CI dashboard for your repository.
That's it! Your repository should now be configured to build on Travis CI.