Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
RedRaysTeam committed Aug 26, 2024
1 parent 90169ec commit 199ec80
Showing 1 changed file with 69 additions and 47 deletions.
116 changes: 69 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,75 @@
stages:
- lint
- test
- build
- deploy
name: CI/CD Pipeline

variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

cache:
paths:
- .pip-cache/
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: flake8 .

lint:
stage: lint
image: python:3.9
before_script:
- pip install flake8
script:
- flake8 .

test:
stage: test
image: python:3.9
before_script:
- pip install -r requirements.txt
- pip install pytest pytest-cov
script:
- pytest tests/ --cov=./ --cov-report=xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Run tests
run: pytest tests/ --cov=./ --cov-report=xml
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage.xml

build:
stage: build
image: python:3.9
script:
- pip install pyinstaller
- pyinstaller --onefile main.py
artifacts:
paths:
- dist/main
build:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build executable
run: pyinstaller --onefile main.py
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: abap-code-scanner
path: dist/main

deploy:
stage: deploy
image: python:3.9
script:
- echo "Deploying application..."
# Add your deployment steps here
only:
- main # This job will only run on the main branch
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy application
run: |
echo "Deploying application..."
# Add your deployment steps here

0 comments on commit 199ec80

Please sign in to comment.