-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90169ec
commit 199ec80
Showing
1 changed file
with
69 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |