Skip to content

Commit

Permalink
Add publish artifact action
Browse files Browse the repository at this point in the history
  • Loading branch information
lsibilla committed Nov 2, 2020
1 parent 4b607a8 commit a3430eb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Build and test

on:
push:
branches: [ main ]
branches: [ main, feature/* ]
pull_request:
branches: [ main ]

Expand All @@ -28,14 +28,25 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
pip install -r requirements.build.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --max-complexity=10 --max-line-length=127 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --max-complexity=10 --max-line-length=127 --exit-zero --statistics
- name: Test with unittest
- name: Test with coverage
run: |
coverage run --source runci -m unittest
coverage report -m
- name: Produce artifacts
run: |
python -m unittest
pip install .
pyinstaller -F --distpath out -n runci runci.spec
- name: Publish artifacts
uses: actions/upload-artifact@v2
with:
name: runci-${{ matrix.os }}-python${{ matrix.python-version }}
path: out
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ ARG OUTPUT=run

FROM python:3.9 as builder

RUN pip install flake8 coverage

COPY requirements.txt /src/requirements.txt
COPY requirements.txt /src/
COPY requirements.build.txt /src/
WORKDIR /src
RUN pip install -r requirements.txt
RUN pip install -r requirements.build.txt

COPY main.py /src/main.py
COPY setup.py /src/setup.py
Expand Down
4 changes: 4 additions & 0 deletions requirements.build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r requirements.txt
flake8
coverage
pyinstaller==4.0
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ click==7.1.2
pip==20.2.4
PyYAML==5.3.1
setuptools==50.3.0
pyinstaller==4.0
parameterized==0.7.4

0 comments on commit a3430eb

Please sign in to comment.