Skip to content

Commit

Permalink
Setup GitHub Actions CI and remove unused Travis config (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacek-lewandowski authored Jun 16, 2024
1 parent 4aae080 commit 09a6553
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 24 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches: [ master]
pull_request:
branches: [ master]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Create virtual environment
run: python -m venv venv

- name: Activate virtual environment
run: source venv/bin/activate

- name: Install dependencies
run: pip install -r requirements.txt && pip install -r tests/requirements.txt

- name: Run linter
run: pylint --output-format msvs --reports y ccmlib || true

- name: Run linter for tests
run: pylint --output-format msvs --reports y tests || true

- name: Run tests
run: |
pytest --junitxml=junit.xml tests
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'junit.xml'
annotate_only: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ ccm.egg-info/
.coverage
dse_creds.txt
.eggs/
junit.xml
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mock==5.1.0
pytest==8.2.1
requests==2.32.2
pylint==3.2.2
5 changes: 3 additions & 2 deletions tests/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from distutils.version import LooseVersion # pylint: disable=import-error, no-name-in-module
from pathlib import Path

import pytest
import requests
from six import StringIO

Expand Down Expand Up @@ -206,7 +207,7 @@ def test_update_java_version(self):
self._test_java_selection_fail("The version of java available on PATH 8 does not match the Java version of the distribution provided via JAVA_HOME 11", path_version=8, home_version=11, explicit_version=None, cassandra_versions=self.all_versions)
self._test_java_selection_fail("JAVA_HOME must be defined if java command is available on the PATH", path_version=8, home_version=None, explicit_version=None, cassandra_versions=self.all_versions)


@pytest.mark.skip(reason="this test is starting nodes - it needs to be refactored to use mocks instead")
class TestCCMLib(ccmtest.Tester):
def test2(self):
self.cluster = Cluster(CLUSTER_PATH, "test2", version='git:trunk')
Expand Down Expand Up @@ -302,7 +303,7 @@ def test_dc_mandatory_on_multidc(self):
with self.assertRaisesRegexp(ccmlib.common.ArgumentError, 'Please specify the DC this node should be added to'):
self.cluster.add(node3, is_seed=False)


# TODO remove this unused class
class TestRunCqlsh(ccmtest.Tester):

def setUp(self):
Expand Down

0 comments on commit 09a6553

Please sign in to comment.