From a3430eb36e1e9bd318be17383985a41c768e5bf6 Mon Sep 17 00:00:00 2001 From: Laurent Sibilla Date: Mon, 2 Nov 2020 17:25:12 +0100 Subject: [PATCH] Add publish artifact action --- .github/workflows/build-and-test.yml | 21 ++++++++++++++++----- Dockerfile | 7 +++---- requirements.build.txt | 4 ++++ requirements.txt | 1 - 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 requirements.build.txt diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 84cf1fd..83c6d5c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -5,7 +5,7 @@ name: Build and test on: push: - branches: [ main ] + branches: [ main, feature/* ] pull_request: branches: [ main ] @@ -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` diff --git a/Dockerfile b/Dockerfile index 1174010..5b9ae1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/requirements.build.txt b/requirements.build.txt new file mode 100644 index 0000000..8ab582f --- /dev/null +++ b/requirements.build.txt @@ -0,0 +1,4 @@ +-r requirements.txt +flake8 +coverage +pyinstaller==4.0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 4cbf30f..561cae3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file