Skip to content

Commit 199ec80

Browse files
committed
init
1 parent 90169ec commit 199ec80

File tree

1 file changed

+69
-47
lines changed

1 file changed

+69
-47
lines changed

.github/workflows/ci.yml

+69-47
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,75 @@
1-
stages:
2-
- lint
3-
- test
4-
- build
5-
- deploy
1+
name: CI/CD Pipeline
62

7-
variables:
8-
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache"
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
98

10-
cache:
11-
paths:
12-
- .pip-cache/
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.9
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install flake8
22+
- name: Lint with flake8
23+
run: flake8 .
1324

14-
lint:
15-
stage: lint
16-
image: python:3.9
17-
before_script:
18-
- pip install flake8
19-
script:
20-
- flake8 .
21-
22-
test:
23-
stage: test
24-
image: python:3.9
25-
before_script:
26-
- pip install -r requirements.txt
27-
- pip install pytest pytest-cov
28-
script:
29-
- pytest tests/ --cov=./ --cov-report=xml
30-
artifacts:
31-
reports:
32-
coverage_report:
33-
coverage_format: cobertura
25+
test:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: 3.9
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements.txt
37+
pip install pytest pytest-cov
38+
- name: Run tests
39+
run: pytest tests/ --cov=./ --cov-report=xml
40+
- name: Upload coverage report
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: coverage-report
3444
path: coverage.xml
3545

36-
build:
37-
stage: build
38-
image: python:3.9
39-
script:
40-
- pip install pyinstaller
41-
- pyinstaller --onefile main.py
42-
artifacts:
43-
paths:
44-
- dist/main
46+
build:
47+
runs-on: ubuntu-latest
48+
needs: [lint, test]
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Set up Python
52+
uses: actions/setup-python@v2
53+
with:
54+
python-version: 3.9
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install pyinstaller
59+
- name: Build executable
60+
run: pyinstaller --onefile main.py
61+
- name: Upload artifact
62+
uses: actions/upload-artifact@v2
63+
with:
64+
name: abap-code-scanner
65+
path: dist/main
4566

46-
deploy:
47-
stage: deploy
48-
image: python:3.9
49-
script:
50-
- echo "Deploying application..."
51-
# Add your deployment steps here
52-
only:
53-
- main # This job will only run on the main branch
67+
deploy:
68+
runs-on: ubuntu-latest
69+
needs: build
70+
if: github.ref == 'refs/heads/main'
71+
steps:
72+
- name: Deploy application
73+
run: |
74+
echo "Deploying application..."
75+
# Add your deployment steps here

0 commit comments

Comments
 (0)