-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alberto Geniola
committed
Oct 7, 2020
1 parent
d6cf519
commit 04b701b
Showing
1 changed file
with
104 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
# Builds the code | ||
# ------------------------------ | ||
build: | ||
name: Build on node ${{matrix.python_version}} | ||
name: Build on node Python ${{matrix.python_version}} | ||
outputs: | ||
tag: ${{steps.tag.outputs.tag}} | ||
runs-on: ubuntu-latest | ||
|
@@ -38,123 +38,117 @@ jobs: | |
echo "Tag: $TAG" | ||
echo "::set-output name=tag::$TAG" | ||
# | ||
# # ------------------------------ | ||
# # Turn on ENV | ||
# # ------------------------------ | ||
# turn-on-env: | ||
# name: Turn on test environment | ||
# runs-on: ubuntu-latest | ||
# env: | ||
# TPLINK_USER: ${{ secrets.TPLINK_USER }} | ||
# TPLINK_PASS: ${{ secrets.TPLINK_PASS }} | ||
# steps: | ||
# - name: Setup Node.js environment | ||
# uses: actions/[email protected] | ||
# with: | ||
# node-version: 11.x | ||
# - uses: actions/checkout@v2 | ||
# - name: Install npm dependencies | ||
# run: | | ||
# pushd ext-res/tests | ||
# npm install | ||
# popd | ||
# - name: Powering on the dev-environment | ||
# run: | | ||
# pushd ext-res/tests | ||
# node ./switch.js --dev MEROSS_LAB --toggle=on | ||
# popd | ||
# | ||
# # --------------------------------- | ||
# # Testing | ||
# # --------------------------------- | ||
# test: | ||
# name: Testing | ||
# runs-on: ubuntu-latest | ||
# needs: [build, turn-on-env] | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Setup Python ${{matrix.python_version}} | ||
# uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: 3.8 | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install pytest | ||
# pip install pytest-html | ||
# pip install pytest-cov | ||
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
# - name: Wait a bit before running tests | ||
# run: | | ||
# echo "Waiting 120 seconds before starting..." | ||
# sleep 120 | ||
# echo "Waiting done." | ||
# - name: Test with pytest | ||
# env: | ||
# MEROSS_EMAIL: ${{ secrets.MEROSS_EMAIL }} | ||
# MEROSS_PASSWORD: ${{ secrets.MEROSS_PASSWORD }} | ||
# run: | | ||
# pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --html=junit/test-results.html --self-contained-html | ||
# - name: Upload pytest test results | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: pytest-results | ||
# path: junit/ | ||
# # Use always() to always run this step to publish test results when there are test failures | ||
# if: ${{ always() }} | ||
# | ||
# - name: Upload pytest test results | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: pytest-results-html | ||
# path: htmlcov/ | ||
# # Use always() to always run this step to publish test results when there are test failures | ||
# if: ${{ always() }} | ||
# | ||
# # ------------------------------ | ||
# # Turn off ENV | ||
# # ------------------------------ | ||
# turn-off-env: | ||
# name: Turn off test environment | ||
# runs-on: ubuntu-latest | ||
# needs: [test] | ||
# env: | ||
# TPLINK_USER: ${{ secrets.TPLINK_USER }} | ||
# TPLINK_PASS: ${{ secrets.TPLINK_PASS }} | ||
# steps: | ||
# - name: Setup Node.js environment | ||
# uses: actions/[email protected] | ||
# with: | ||
# node-version: 11.x | ||
# - uses: actions/checkout@v2 | ||
# - name: Install npm dependencies | ||
# run: | | ||
# pushd ext-res/tests | ||
# npm install | ||
# popd | ||
# - name: Powering on the dev-environment | ||
# run: | | ||
# pushd ext-res/tests | ||
# node ./switch.js --dev MEROSS_LAB --toggle=off | ||
# popd | ||
# if: ${{ always() }} | ||
# ------------------------------ | ||
# Turn on ENV | ||
# ------------------------------ | ||
turn-on-env: | ||
name: Turn on test environment | ||
runs-on: ubuntu-latest | ||
env: | ||
TPLINK_USER: ${{ secrets.TPLINK_USER }} | ||
TPLINK_PASS: ${{ secrets.TPLINK_PASS }} | ||
steps: | ||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 11.x | ||
- uses: actions/checkout@v2 | ||
- name: Install npm dependencies | ||
run: | | ||
pushd ext-res/tests | ||
npm install | ||
popd | ||
- name: Powering on the dev-environment | ||
run: | | ||
pushd ext-res/tests | ||
node ./switch.js --dev MEROSS_LAB --toggle=on | ||
popd | ||
# --------------------------------- | ||
# Testing | ||
# --------------------------------- | ||
test: | ||
name: Testing | ||
runs-on: ubuntu-latest | ||
needs: [build, turn-on-env] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python ${{matrix.python_version}} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install pytest-html | ||
pip install pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Wait a bit before running tests | ||
run: | | ||
echo "Waiting 120 seconds before starting..." | ||
sleep 120 | ||
echo "Waiting done." | ||
- name: Test with pytest | ||
env: | ||
MEROSS_EMAIL: ${{ secrets.MEROSS_EMAIL }} | ||
MEROSS_PASSWORD: ${{ secrets.MEROSS_PASSWORD }} | ||
run: | | ||
pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --html=junit/test-results.html --self-contained-html | ||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-results | ||
path: junit/ | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-results-html | ||
path: htmlcov/ | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
|
||
# ------------------------------ | ||
# Turn off ENV | ||
# ------------------------------ | ||
turn-off-env: | ||
name: Turn off test environment | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
env: | ||
TPLINK_USER: ${{ secrets.TPLINK_USER }} | ||
TPLINK_PASS: ${{ secrets.TPLINK_PASS }} | ||
steps: | ||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 11.x | ||
- uses: actions/checkout@v2 | ||
- name: Install npm dependencies | ||
run: | | ||
pushd ext-res/tests | ||
npm install | ||
popd | ||
- name: Powering on the dev-environment | ||
run: | | ||
pushd ext-res/tests | ||
node ./switch.js --dev MEROSS_LAB --toggle=off | ||
popd | ||
if: ${{ always() }} | ||
|
||
# ------------------------------ | ||
# Pre-Release on DEV | ||
# ------------------------------ | ||
pre-release: | ||
name: Pre-Release on GitHub | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
needs: [build, test] | ||
steps: | ||
- name: Calculate Version | ||
id: debug | ||
run: | | ||
echo "Workspace." | ||
ls -l $GITHUB_WORKSPACE | ||
echo "Current dir" | ||
ls -l | ||
- uses: actions/checkout@v2 | ||
- name: Calculate Version | ||
id: tag | ||
run: | | ||
|