From 0f9ed450e17eabd59feba58de0b2a11912ccacb3 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 13 Dec 2019 18:32:54 +0800 Subject: [PATCH 1/5] Create unittest.yml add github action for unittest. --- .github/workflows/unittest.yml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 00000000..af9d207c --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,39 @@ +name: Python package + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + poetry --version + poetry install -vvv + - name: Test package installation + run: | + poetry build + ls dist/*.whl | xargs pip install # test installation + hrun -V + - name: Smoketest for hrun command + run: | + cd tests/httpbin && hrun basic.yml --log-level debug --failfast && cd - + - name: Smoketest for hrun command + run: | + python -m httprunner.cli hrun -V + python -m httprunner.cli hrun -h + poetry run coverage run --source=httprunner -m unittest discover + poetry run coveralls From 6a7ded31947a559c2b7fa47a399cae776db61602 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 13 Dec 2019 18:43:08 +0800 Subject: [PATCH 2/5] Update unittest.yml remove coveralls --- .github/workflows/unittest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index af9d207c..33b138c9 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -36,4 +36,3 @@ jobs: python -m httprunner.cli hrun -V python -m httprunner.cli hrun -h poetry run coverage run --source=httprunner -m unittest discover - poetry run coveralls From 8b6ec5696a352170d0172a9b217c8ab661928e3d Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 13 Dec 2019 18:56:00 +0800 Subject: [PATCH 3/5] Update unittest.yml add coveralls --- .github/workflows/unittest.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 33b138c9..3b48a821 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -28,11 +28,24 @@ jobs: poetry build ls dist/*.whl | xargs pip install # test installation hrun -V - - name: Smoketest for hrun command + - name: Run smoketest for hrun command run: | cd tests/httpbin && hrun basic.yml --log-level debug --failfast && cd - - - name: Smoketest for hrun command + - name: Run unittest for httprunner run: | python -m httprunner.cli hrun -V python -m httprunner.cli hrun -h poetry run coverage run --source=httprunner -m unittest discover + + - name: Coveralls GitHub Action + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v1.0.1 + with: + # + github-token: ${{ secrets.GITHUB_TOKEN }} + # Path to lcov file + # path-to-lcov: # default is ./coverage/lcov.info + # Set to true if you are running parallel jobs, then use "parallel_finished: true" for the last action. + parallel: true # optional + # Set to true for the last action when using "parallel: true". + parallel-finished: true # optional From 00660dce6d909e797d6c4ec9bb82bb5d7663fca1 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 13 Dec 2019 19:01:26 +0800 Subject: [PATCH 4/5] Update unittest.yml fix coveralls --- .github/workflows/unittest.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 3b48a821..0d8a69d1 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -36,15 +36,13 @@ jobs: python -m httprunner.cli hrun -V python -m httprunner.cli hrun -h poetry run coverage run --source=httprunner -m unittest discover - - - name: Coveralls GitHub Action + poetry run coverage report -m - name: Coveralls GitHub Action uses: coverallsapp/github-action@v1.0.1 with: - # github-token: ${{ secrets.GITHUB_TOKEN }} # Path to lcov file - # path-to-lcov: # default is ./coverage/lcov.info + path-to-lcov: .coverage # default is ./coverage/lcov.info # Set to true if you are running parallel jobs, then use "parallel_finished: true" for the last action. parallel: true # optional # Set to true for the last action when using "parallel: true". From 9bcd940960d0a36e59ede5c9244ad0095d5f8f61 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 13 Dec 2019 19:16:19 +0800 Subject: [PATCH 5/5] Update unittest.yml replace coveralls with codecov --- .github/workflows/unittest.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 0d8a69d1..d20fc786 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -37,13 +37,16 @@ jobs: python -m httprunner.cli hrun -h poetry run coverage run --source=httprunner -m unittest discover poetry run coverage report -m - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.0.1 + - name: Codecov + uses: codecov/codecov-action@v1.0.5 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - # Path to lcov file - path-to-lcov: .coverage # default is ./coverage/lcov.info - # Set to true if you are running parallel jobs, then use "parallel_finished: true" for the last action. - parallel: true # optional - # Set to true for the last action when using "parallel: true". - parallel-finished: true # optional + # User defined upload name. Visible in Codecov UI + name: httprunner # optional + # Repository upload token - get it from codecov.io + token: ${{ secrets.CODECOV_TOKEN }} + # Path to coverage file to upload + file: .coverage # optional + # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) + flags: unittests # optional + # Specify whether or not CI build should fail if Codecov runs into an error during upload + fail_ci_if_error: true # optional