language: python python: - "3.7" - "3.8" - "3.9" # Command to install dependencies install: - pip install -r requirements.txt - pip install pytest pytest-cov # Command to run tests script: - pytest --cov=./ tests/ # Specify branches to build branches: only: - main - develop # Cache pip dependencies cache: pip # Run jobs in parallel jobs: include: - name: "Lint" python: "3.9" before_script: - pip install flake8 script: - flake8 . - name: "Docs" python: "3.9" before_script: - pip install sphinx script: - sphinx-build -b html docs docs/_build after_success: - pip install coveralls - coveralls notifications: email: on_success: never on_failure: always
language: node_js node_js: - "12" - "14" - "16" # Specify the operating system os: - linux - osx # Cache dependencies cache: directories: - node_modules # Install dependencies install: - npm ci # Run tests script: - npm run test - npm run build # Run jobs in parallel jobs: include: - stage: lint node_js: "16" script: npm run lint - stage: coverage node_js: "16" script: npm run test:coverage # Deploy to npm deploy: provider: npm email: "[email protected]" api_key: $NPM_TOKEN on: tags: true branch: main # Notifications notifications: email: on_success: never on_failure: always slack: rooms: - secure: "encrypted-slack-webhook-url"
language: java jdk: - openjdk11 - openjdk14 # Cache dependencies cache: directories: - $HOME/.m2 # Build stages stages: - test - name: deploy if: branch = main jobs: include: - stage: test name: "Unit Tests" script: mvn test - stage: test name: "Integration Tests" script: mvn verify -Pintegration-tests - stage: deploy name: "Deploy to Staging" script: mvn deploy -Pstaging # Notifications notifications: email: recipients: - [email protected] on_success: change on_failure: always # Before install steps before_install: - chmod +x mvnw # Main build script script: - ./mvnw clean install # After success steps after_success: - bash <(curl -s https://codecov.io/bash) # Only build these branches branches: only: - main - develop
language: cpp compiler: - gcc - clang before_install: - sudo apt-get update - sudo apt-get install -y cmake script: - mkdir build - cd build - cmake .. - make - make test notifications: email: false
language: php php: - 7.4 - 8.0 - 8.1 before_script: - composer self-update - composer install --no-interaction script: - vendor/bin/phpunit - vendor/bin/phpcs cache: directories: - $HOME/.composer/cache notifications: email: false
language: rust rust: - stable - beta - nightly matrix: allow_failures: - rust: nightly fast_finish: true cache: cargo before_script: - rustup component add clippy script: - cargo build --verbose - cargo test --verbose - cargo clippy -- -D warnings notifications: email: false
language: go go: - 1.16.x - 1.17.x - 1.18.x - tip matrix: allow_failures: - go: tip fast_finish: true before_install: - go get -t -v ./... script: - go test -race -coverprofile= coverage.txt -covermode=atomic - go vet ./... - diff -u <(echo -n) <(gofmt -d .) after_success: - bash <(curl -s https://codecov.io/bash) notifications: email: false
language: csharp mono: none dotnet: 6.0.100 install: - dotnet restore script: - dotnet build - dotnet test notifications: email: false branches: only: - main - develop cache: directories: - $HOME/.nuget/packages
language: ruby rvm: - 2.6 - 2.7 - 3.0 install: - bundle install script: - bundle exec rake test after_success: - bundle exec rake coveralls:push notifications: email: recipients: - [email protected] on_success: always on_failure: always
language: python python: - "3.7" - "3.8" - "3.9" # Command to install dependencies install: - pip install -r requirements.txt - pip install pytest pytest-cov # Command to run tests script: - pytest --cov=./ tests/ # Specify branches to build branches: only: - main - develop # Cache pip dependencies cache: pip # Run jobs in parallel jobs: include: - name: "Lint" python: "3.9" before_script: - pip install flake8 script: - flake8 . - name: "Docs" python: "3.9" before_script: - pip install sphinx script: - sphinx-build -b html docs docs/_build after_success: - pip install coveralls - coveralls notifications: email: on_success: never on_failure: always
language: node_js node_js: - "12" - "14" - "16" # Specify the operating system os: - linux - osx # Cache dependencies cache: directories: - node_modules # Install dependencies install: - npm ci # Run tests script: - npm run test - npm run build # Run jobs in parallel jobs: include: - stage: lint node_js: "16" script: npm run lint - stage: coverage node_js: "16" script: npm run test:coverage # Deploy to npm deploy: provider: npm email: "[email protected]" api_key: $NPM_TOKEN on: tags: true branch: main # Notifications notifications: email: on_success: never on_failure: always slack: rooms: - secure: "encrypted-slack-webhook-url"
language: java jdk: - openjdk11 - openjdk14 # Cache dependencies cache: directories: - $HOME/.m2 # Build stages stages: - test - name: deploy if: branch = main jobs: include: - stage: test name: "Unit Tests" script: mvn test - stage: test name: "Integration Tests" script: mvn verify -Pintegration-tests - stage: deploy name: "Deploy to Staging" script: mvn deploy -Pstaging # Notifications notifications: email: recipients: - [email protected] on_success: change on_failure: always # Before install steps before_install: - chmod +x mvnw # Main build script script: - ./mvnw clean install # After success steps after_success: - bash <(curl -s https://codecov.io/bash) # Only build these branches branches: only: - main - develop
language: cpp compiler: - gcc - clang before_install: - sudo apt-get update - sudo apt-get install -y cmake script: - mkdir build - cd build - cmake .. - make - make test notifications: email: false
language: php php: - 7.4 - 8.0 - 8.1 before_script: - composer self-update - composer install --no-interaction script: - vendor/bin/phpunit - vendor/bin/phpcs cache: directories: - $HOME/.composer/cache notifications: email: false
language: rust rust: - stable - beta - nightly matrix: allow_failures: - rust: nightly fast_finish: true cache: cargo before_script: - rustup component add clippy script: - cargo build --verbose - cargo test --verbose - cargo clippy -- -D warnings notifications: email: false
language: go go: - 1.16.x - 1.17.x - 1.18.x - tip matrix: allow_failures: - go: tip fast_finish: true before_install: - go get -t -v ./... script: - go test -race -coverprofile= coverage.txt -covermode=atomic - go vet ./... - diff -u <(echo -n) <(gofmt -d .) after_success: - bash <(curl -s https://codecov.io/bash) notifications: email: false
language: csharp mono: none dotnet: 6.0.100 install: - dotnet restore script: - dotnet build - dotnet test notifications: email: false branches: only: - main - develop cache: directories: - $HOME/.nuget/packages
language: ruby rvm: - 2.6 - 2.7 - 3.0 install: - bundle install script: - bundle exec rake test after_success: - bundle exec rake coveralls:push notifications: email: recipients: - [email protected] on_success: always on_failure: always
language: python python: - "3.7" - "3.8" - "3.9" env: - DJANGO_VERSION=2.2 - DJANGO_VERSION=3.0 - DJANGO_VERSION=3.1 matrix: include: - python: "3.9" env: DJANGO_VERSION=3.2 exclude: - python: "3.7" env: DJANGO_VERSION=3.1 allow_failures: - python: "3.9" env: DJANGO_VERSION=3.2 before_install: - pip install -U pip - pip install -U setuptools - pip install -q Django==$DJANGO_VERSION install: - pip install -r requirements.txt script: - python manage.py test after_success: - coveralls notifications: email: false
language: python python: - "3.8" services: - mongodb - redis - mysql env: - DB=mongodb - DB=redis - DB=mysql before_script: - if [[ "$DB" == "mongodb" ]]; then mongo mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles: ["readWrite"]});'; fi - if [[ "$DB" == "mysql" ]]; then mysql -e 'CREATE DATABASE IF NOT EXISTS mydb_test; '; fi script: - if [[ "$DB" == "mongodb" ]]; then python test_mongodb.py; fi - if [[ "$DB" == "redis" ]]; then python test_redis.py; fi - if [[ "$DB" == "mysql" ]]; then python test_mysql.py; fi
language: python python: - "3.8" # Install dependencies install: - pip install -r requirements.txt # Run tests script: - pytest # Integration with Slack for notifications notifications: slack: your-slack-workspace:your-slack-token # Integration with Codecov for code coverage reports after_success: - pip install codecov - codecov # Integration with GitHub Pages for documentation deployment deploy: provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN on: branch: main
language: python python: - "3.8" script: - python -m pytest tests/ notifications: email: recipients: - [email protected] on_success: change on_failure: always slack: rooms: - secure: "encrypted-slack-webhook-url" on_success: always on_failure: always template: - "Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) of %{repository_slug} @%{branch} by %{author} %{result} in %{duration}" webhooks: urls: - https://webhook.site/your-unique-id on_success: change on_failure: always irc: channels: - "irc.freenode.org#myproject" template: - "%{repository} (%{commit}) : %{message}" - "Build details: %{build_url}" pushover: api_key: "pushover-api-key" users: - "pushover-user-key" template: "%{repository} (%{commit}) : %{message} - %{duration}" after_failure: - cat /home/travis/build/your-github-username/ your-repo-name/tests/test-suite.log
language: python python: - "3.8" stages: - test - name: deploy if: branch = main jobs: include: - stage: test name: "Unit Tests" script: python -m unittest discover tests/unit - stage: test name: "Integration Tests" script: python -m unittest discover tests/integration - stage: deploy name: "Deploy to Production" script: - pip install awscli - aws s3 sync . s3://my-bucket/ --delete env: global: - PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR before_install: - pip install -r requirements.txt branches: only: - main - develop notifications: email: on_success: never on_failure: always
language: generic jobs: include: # Linux builds - os: linux arch: amd64 - os: linux arch: arm64 # macOS builds - os: osx osx_image: xcode12.5 # Windows builds - os: windows script: - echo "Running tests on $TRAVIS_OS_NAME $TRAVIS_CPU_ARCH" - # Add your build and test commands here notifications: email: false
language: python python: - "3.7" - "3.8" - "3.9" env: - DJANGO_VERSION=2.2 - DJANGO_VERSION=3.0 - DJANGO_VERSION=3.1 matrix: include: - python: "3.9" env: DJANGO_VERSION=3.2 exclude: - python: "3.7" env: DJANGO_VERSION=3.1 allow_failures: - python: "3.9" env: DJANGO_VERSION=3.2 before_install: - pip install -U pip - pip install -U setuptools - pip install -q Django==$DJANGO_VERSION install: - pip install -r requirements.txt script: - python manage.py test after_success: - coveralls notifications: email: false
language: python python: - "3.8" services: - mongodb - redis - mysql env: - DB=mongodb - DB=redis - DB=mysql before_script: - if [[ "$DB" == "mongodb" ]]; then mongo mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles: ["readWrite"]});'; fi - if [[ "$DB" == "mysql" ]]; then mysql -e 'CREATE DATABASE IF NOT EXISTS mydb_test; '; fi script: - if [[ "$DB" == "mongodb" ]]; then python test_mongodb.py; fi - if [[ "$DB" == "redis" ]]; then python test_redis.py; fi - if [[ "$DB" == "mysql" ]]; then python test_mysql.py; fi
language: python python: - "3.8" # Install dependencies install: - pip install -r requirements.txt # Run tests script: - pytest # Integration with Slack for notifications notifications: slack: your-slack-workspace:your-slack-token # Integration with Codecov for code coverage reports after_success: - pip install codecov - codecov # Integration with GitHub Pages for documentation deployment deploy: provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN on: branch: main
language: python python: - "3.8" script: - python -m pytest tests/ notifications: email: recipients: - [email protected] on_success: change on_failure: always slack: rooms: - secure: "encrypted-slack-webhook-url" on_success: always on_failure: always template: - "Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) of %{repository_slug} @%{branch} by %{author} %{result} in %{duration}" webhooks: urls: - https://webhook.site/your-unique-id on_success: change on_failure: always irc: channels: - "irc.freenode.org#myproject" template: - "%{repository} (%{commit}) : %{message}" - "Build details: %{build_url}" pushover: api_key: "pushover-api-key" users: - "pushover-user-key" template: "%{repository} (%{commit}) : %{message} - %{duration}" after_failure: - cat /home/travis/build/your-github-username/ your-repo-name/tests/test-suite.log
language: python python: - "3.8" stages: - test - name: deploy if: branch = main jobs: include: - stage: test name: "Unit Tests" script: python -m unittest discover tests/unit - stage: test name: "Integration Tests" script: python -m unittest discover tests/integration - stage: deploy name: "Deploy to Production" script: - pip install awscli - aws s3 sync . s3://my-bucket/ --delete env: global: - PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR before_install: - pip install -r requirements.txt branches: only: - main - develop notifications: email: on_success: never on_failure: always
language: generic jobs: include: # Linux builds - os: linux arch: amd64 - os: linux arch: arm64 # macOS builds - os: osx osx_image: xcode12.5 # Windows builds - os: windows script: - echo "Running tests on $TRAVIS_OS_NAME $TRAVIS_CPU_ARCH" - # Add your build and test commands here notifications: email: false