-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable travis and update GitHub Actions (#149)
- Loading branch information
1 parent
38ae09f
commit 3a9bd75
Showing
10 changed files
with
258 additions
and
71 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 |
---|---|---|
@@ -1,33 +1,192 @@ | ||
name: rfhub2-pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- master | ||
on: push | ||
|
||
jobs: | ||
build: | ||
|
||
test: | ||
name: Build and test rfhub2 | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [13.x] | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run Find changed files. | ||
id: changed_files | ||
uses: tj-actions/verify-changed-files@v2 | ||
with: | ||
files: "version.py" | ||
|
||
- name: Perform action when files change. | ||
if: steps.changed_files.outputs.files_changed == 'true' | ||
run: | | ||
echo "Do something when files have changed." | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt -r requirements-dev.txt -r requirements-postgres.txt | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name : Tests | ||
run: | | ||
python -m coverage run --source rfhub2 -m unittest tests | ||
|
||
# - name: Cache Python packages | ||
# uses: actions/cache@v2 | ||
# id: cache-pip | ||
# with: | ||
# path: ~/.cache/pip | ||
# key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt', '**/requirements-postgres.txt') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt', '**/requirements-postgres.txt') }} | ||
|
||
# - name: Install Python dependencies | ||
# run: | | ||
# pip install -r requirements.txt | ||
# pip install -r requirements-dev.txt | ||
# pip install -r requirements-postgres.txt | ||
|
||
# - name : Unit tests and coverage check | ||
# run: | | ||
# python -m coverage run --source rfhub2 -m unittest tests | ||
# python -m coverage xml | ||
|
||
# - name: Black check | ||
# run: | | ||
# black --check rfhub2 tests | ||
|
||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v1 | ||
# with: | ||
# file: ./coverage.xml | ||
# flags: unittests | ||
# fail_ci_if_error: true | ||
|
||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
|
||
# - name: Install yarn dependencies | ||
# uses: bahmutov/npm-install@v1 | ||
# with: | ||
# working-directory: frontend | ||
|
||
# - uses: nanasess/setup-chromedriver@master | ||
# - run: | | ||
# export DISPLAY=:99 | ||
# chromedriver --url-base=/wd/hub & | ||
# sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | ||
|
||
# - name: Build UI | ||
# run: ./build_ui.sh | ||
|
||
# - name: Build rfhub2 python package | ||
# run: python setup.py sdist bdist_wheel | ||
|
||
# - uses: actions/upload-artifact@master | ||
# with: | ||
# name: rfhub2_whl_${{ matrix.python-version }} | ||
# path: /home/runner/work/rfhub2/rfhub2/dist | ||
|
||
# - name: Install rfhub2 in env | ||
# run: pip install $(find dist -type f -iname "rfhub2-*.whl")[postgresql] | ||
|
||
# - name: Run default Robot tests | ||
# run: | | ||
# robot -A tests/acceptance/conf/default.args -d results/ tests/acceptance | ||
|
||
# - name: Upload default tests results | ||
# if: failure() | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: Default tests | ||
# path: /home/runner/work/rfhub2/rfhub2/results/ | ||
|
||
# - name: Run postgres Robot Framework tests | ||
# run: | | ||
# robot -A tests/acceptance/conf/postgres.args tests/acceptance | ||
|
||
# - name: Upload postgres tests results | ||
# if: failure() | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: Postgres tests | ||
# path: /home/runner/work/rfhub2/rfhub2/log.html | ||
|
||
package_check: | ||
name: Install rfhub2 package in separate env | ||
needs: test | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# - uses: actions/download-artifact@master | ||
# with: | ||
# name: rfhub2_whl_${{ matrix.python-version }} | ||
# path: /home/runner/work/rfhub2/rfhub2/dist | ||
|
||
# - name: Install rfhub2 in env | ||
# run: pip install $(find dist -type f -iname "rfhub2-*.whl")[postgresql] | ||
|
||
push_and_deploy: | ||
name: Push and deploy rfhub2 | ||
needs: package_check | ||
if: github.extract_branch.outputs.branch == 'master' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Run Find changed files. | ||
id: changed_files | ||
uses: tj-actions/verify-changed-files@v2 | ||
with: | ||
files: "rfhub2/version.py" | ||
|
||
- name: Set up Python 3.6 | ||
if: steps.changed_files.outputs.files_changed == 'true' | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.6 | ||
|
||
# - uses: actions/download-artifact@master | ||
# with: | ||
# name: rfhub2_whl_3.6 | ||
# path: /home/runner/work/rfhub2/rfhub2/dist | ||
|
||
# - name: Publish a Python distribution to PyPI | ||
# uses: pypa/gh-action-pypi-publish@master | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.pypi_password }} | ||
|
||
# - name: Deploy to Heroku | ||
# uses: Suvink/[email protected] | ||
# with: | ||
# heroku_app_name: rfhub2-demo | ||
# heroku_email: [email protected] | ||
# dontuseforce: false | ||
# env: | ||
# HEROKU_TOKEN: '${{ secrets.HEROKU_AUTH_TOKEN }}' | ||
# BOT_TOKEN: '${{ secrets.BOT_TOKEN }}' | ||
# CHAT_ID: '${{ secrets.CHAT_ID }}' |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: rfhub2-push-and-deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'rfhub2/version.py' | ||
|
||
jobs: | ||
push: | ||
name: Push rfhub2 to PyPI | ||
if: steps.extract_branch.outputs.branch == 'master' | ||
needs: test | ||
runs-on: ubuntu-latest | ||
node-version: 13.x | ||
python-version: 3.8 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ python-version }} | ||
|
||
- name: Cache Python packages | ||
uses: actions/cache@v1 | ||
id: cache-pip | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt', '**/requirements-postgres.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt', '**/requirements-postgres.txt') }} | ||
- name: Use Node.js ${{ node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ node-version }} | ||
|
||
- name: Install yarn dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
working-directory: frontend | ||
|
||
- name: Build UI | ||
run: ./build_ui.sh | ||
|
||
- name: Build rfhub2 python package | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
|
||
- name: Deploy to Heroku | ||
uses: Suvink/[email protected] | ||
with: | ||
heroku_app_name: rfhub2-demo | ||
heroku_email: [email protected] | ||
dontuseforce: false | ||
env: | ||
HEROKU_TOKEN: '${{ secrets.HEROKU_AUTH_TOKEN }}' | ||
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}' | ||
CHAT_ID: '${{ secrets.CHAT_ID }}' |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#!/bin/bash | ||
# !!!Please use clean paramater for this bash script if you need to clean static files.!!! | ||
pushd frontend | ||
yarn build | ||
popd | ||
rm -r rfhub2/static/* | ||
rm rfhub2/templates/index.html | ||
if [ "$1" == "clean" ]; then | ||
rm -r rfhub2/static/* | ||
rm rfhub2/templates/index.html | ||
fi | ||
cp -r frontend/build/* rfhub2/static | ||
mv rfhub2/static/index.html rfhub2/templates/index.html |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# default arguments; any other argument files should include | ||
# this file. | ||
-C ansi | ||
--variable ACTIVATE_VENV:. atests-venv/bin/activate && |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# default arguments; any other argument files should include | ||
# this file. | ||
-C ansi | ||
--variable ACTIVATE_VENV:. atests-venv/bin/activate && | ||
--variable DB_URI:RFHUB_DB_URI=postgresql://postgres:postgres@localhost:5432/postgres |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# default arguments; any other argument files should include | ||
# this file. | ||
-C ansi | ||
--variable ACTIVATE_VENV: |
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
Oops, something went wrong.