Skip to content

Commit

Permalink
Merge pull request #1 from SED/github-workflow
Browse files Browse the repository at this point in the history
Migrate to Github
  • Loading branch information
Alex Van Brunt authored and GitHub Enterprise committed Sep 24, 2024
2 parents 71465c3 + d00b5d4 commit 9482de3
Show file tree
Hide file tree
Showing 13 changed files with 228 additions and 133 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[run]
source = src/cbc_syslog
relative_files = True
branch = True

[report]
exclude_lines =
pragma: no cover
Expand Down
210 changes: 210 additions & 0 deletions .github/workflows/verify-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
name: verify-python
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
lint:
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/python:3.8"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: pip3 install -r requirements.txt
- run: ./bin/linters.sh

python38:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/python:3.8"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: pip3 install -r requirements.txt
- run: pytest

python39:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/python:3.9"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: pip3 install -r requirements.txt
- run: pytest

python310:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/python:3.10"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: pip3 install -r requirements.txt
- run: pytest

python311:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/python:3.11"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: pip3 install -r requirements.txt
- run: pytest

python312:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/python:3.12"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: pip3 install -r requirements.txt
- run: pytest

amazonlinux:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/amazonlinux:latest"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- run: yum -y install tar xz gzip
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: |
yum -y install python3-devel python3-pip
pip3 install setuptools
pip3 install -r requirements.txt
pip3 install .
- run: pytest

rhel:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/redhat/ubi8:latest"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: |
dnf install -y redhat-rpm-config gcc libffi-devel python38-devel openssl-devel
pip3 install --upgrade pip
pip3 install .[test]
- run: pytest

suse:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/opensuse/tumbleweed"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- run: zypper --non-interactive install tar xz gzip
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: |
zypper --non-interactive install python3-devel python3-pip gcc
python3 -m venv env
source env/bin/activate
env/bin/pip3 install -r requirements.txt
env/bin/pip3 install .
- run: env/bin/python3 -m pytest

ubuntu:
needs: lint
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/ubuntu:20.04"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
timeout-minutes: 120
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 20
- run: |
apt-get update
apt-get install -y python3 python3-pip
pip3 install -r requirements.txt
pip3 install .
- run: pytest

sonarqube:
needs: ubuntu
runs-on: cbre
container:
image: "${{ vars.BDCM_DOCKER_GATEWAY }}/ubuntu:20.04"
credentials:
username: ${{ vars.CB_ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.CB_ARTIFACTORY_DOCKER_TOKEN }}
steps:
- uses: actions-brcm/[email protected]
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- run: |
apt-get update
apt-get install -y python3 python3-pip
pip3 install -r requirements.txt
pip3 install .
- run: ./bin/tests_n_reports.sh
- uses: actions-brcm/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
5 changes: 2 additions & 3 deletions bin/tests_n_reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ set -e
echo 'Running tests....'
coverage run -m pytest

echo 'Running report and sending to coveralls....'
coverage report -m
coveralls
echo 'Generating report....'
coverage xml
17 changes: 0 additions & 17 deletions codeship-services.yml

This file was deleted.

22 changes: 0 additions & 22 deletions codeship-steps.yml

This file was deleted.

22 changes: 0 additions & 22 deletions docker/amazon/Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions docker/rhel/Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions docker/suse/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions docker/ubuntu/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions env.encrypted

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ flask >=3.0.3
cryptography
pytest==7.2.1
coverage==6.5.0
coveralls==3.3.1
flake8==5.0.4
flake8-colors==0.1.9
flake8-docstrings==1.7.0
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"cryptography",
"pytest==7.2.1",
"coverage==6.5.0",
"coveralls==3.3.1",
"flake8==5.0.4",
"flake8-colors==0.1.9",
"flake8-docstrings==1.7.0",
Expand Down
13 changes: 13 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sonar.projectKey=cb-devrel-cbc-syslog
sonar.python.coverage.reportPaths=coverage.xml

# Define the same root directory for sources and tests
sonar.sources = src/
sonar.tests = src/

# Include test subdirectories in test scope
sonar.test.inclusions = src/**/tests/**/*
sonar.test.exclusions = src/**/tests/fixtures/**/*

# Exclude test subdirectories from source scope
sonar.exclusions = src/**/tests/**/*

0 comments on commit 9482de3

Please sign in to comment.