Skip to content

Commit d550796

Browse files
authored
Enhance CI workflow with build and upload steps
Updated CI workflow to include package building and artifact upload.
1 parent 1e0ab9b commit d550796

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application -CI
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: "3.10"
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest build
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
32+
- name: Lint with flake8
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
39+
- name: Build Package
40+
run: python -m build
41+
42+
- name: Test with pytest
43+
run: |
44+
echo "pytest .."
45+
46+
- name: Package Python Code
47+
uses: actions/upload-artifact@v5.0.0
48+
with:
49+
# Artifact name
50+
name: Python-app
51+
# A file, directory or wildcard pattern that describes what to upload
52+
path: ./*

0 commit comments

Comments
 (0)