Unverified Commit af1ec83f authored by Tao Feng's avatar Tao Feng Committed by GitHub

feat: add github actions for FE (#592)

Signed-off-by: 's avatarTao Feng <fengtao04@gmail.com>
parent d2fe9ce9
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
on: pull_request
jobs:
pre-commit:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
test-unit-python:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: ['3.6.x', '3.7.x']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip3 install -r requirements.txt && pip3 install .[all] && pip3 install codecov
- name: Run python unit tests
run: make test
test-unit-frontend:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install and Lint
working-directory: ./amundsen_application/static
run: |
npm install
npm install codecov -g
npm run lint
npm run build --if-present
- name: Test
working-directory: ./amundsen_application/static
run: npm run test
env:
CI: true
name: Build and Deploy
on:
push:
branches:
- master
tags:
- '*'
jobs:
build-and-publish-python-module:
name: Build and publish python module to pypi
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
build-and-publish-docker-image:
name: Build and publish docker image
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@2.8
with:
name: amundsen-io/amundsensearchlibrary
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_names: true
matrix:
include:
- language: python
python:
- '3.6'
env:
- IS_DEPLOYABLE=true
before_install:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
install:
- pip3 install -r requirements.txt
- pip3 install codecov
script:
- make test
after_success:
- codecov
- language: node_js
node_js:
- '12'
env:
- IS_DEPLOYABLE=false
before_install:
- cd amundsen_application/static
install:
- npm install
- npm install codecov -g
script:
- npm run lint
- npm run build
- npm run test
after_success:
- codecov
before_deploy:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
deploy:
- provider: pypi
user: amundsen-dev
password:
secure: QohFWueXLLye2i8KSNRJGqLU4rw8lZJqlByergtyxKpjTuxxMfgl0ejDlu0qZ6qlGiP3kAaS4zAjwDYCNelQmywYODC4UpjarvhfttkltgPH2YDSgFcMxJt5FRXU8Vxwh+AscNo1sZRzXfFPWMRN525mcxDu6CYFCBp2txFW2O9abNHFPU46Jze314tAgmdceHU/Hbs6WT/mBRQRELXoxbw2u2HBVMiHLKCwfio2857xshKGw5Rz1kvt/FVJ1PxwBP57I+6YUfPoy5rOUZWtSuCdBmNlVFk3v1rX/AIap8+PIMACGlUpKhJVRaAGTnSEVzv6bGD6SMOPZ/nVIYl3GssDhRB5uDP2ttilS+Kvbk9BQ/rbcidxxhIGQ8nDx/Auj6PK2e6Hp77N4k4yKxFjz/8cOQhHIKen9LFDXxGfbyoXV5Izf0aYKgvIJxlh3T8Mg42UbyfvztudyjHI1aG1VRF3Qq6Dt0y2yPJYefeAiLqQnCkrDEKTnr6Kxv5lLEi/XTj+tl/pk+OhuVWHyIBGiG+Nb4lZOuW7uo7xqANu6/Ei9plMK7X5ibpPzzRzAWLSpYHOC7dM457XEbgEcWgHzWMC2u1mHoFDlyKcOOqgkgcwmWJZZI4gVVob9uxukdoPN4IABkWhAXC5wQJ3C1eAddRcDAry0bZvFreupsrLIho=
distributions: sdist bdist_wheel
skip_existing: true
on:
tags: true
repo: amundsen-io/amundsenfrontendlibrary
condition: "$IS_DEPLOYABLE = true"
- provider: script
script: docker login -u amundsendev -p $DOCKER_LOGIN_PASSWORD && make build-push-image
on:
branch: master
tags: true
repo: amundsen-io/amundsenfrontendlibrary
condition: "$IS_DEPLOYABLE = true"
env:
global:
secure: EOmj0rOmPTbFz/YUlwDAhi5/9acDayk5lAQeRWQr2HxjDZQzA4qxePQFx4QPAijRHHc5IJ1WwbZdt5OLXIksnFmeCdGD3dBUnbL6fTNCe8YRxtRHZaYlV0/HG+Wmr3hLEMe9RXNSwze7ACcfwByZ3A/Zl3vd9XA3tDkW6PIpMS9I2yHy/CDRxZTVXNAxLJOGSJU97D5wGfAp5Pnp4P4DVeipnmHYtXOczp6LWakETRrCdtMGutTslS0z9zVwqNZUUIF0Tor/re9roEG85soOWNW1Fk9XWdQNAdX6DArkt7Kw8qhZNmDgLP6T49TtMndXRBUg6A1S8yytmte0mfbZjMB77dmvaA9q6refpgk15dhkXFfPUBHf8FlWz+7p4PVDntb7L4zRMZPL/6IYulLhA/83ccGI9e3BLY+jxTH8ao/Mgv4V/jDnX27gxlaUruAjsDceZe6DU73PnHI8gLKr06OZIpq8+GCHeJLj1PzIQwjLNPE68iFrER8HXtzgymZWccV8KWRX8uyX5cZMSsZImeOditl6Xs7dJWrLHCT8wjo+WidG6A8anJOhLNqryOqX5GkCJBL2qc2+7N8zTTZISQFBKE+/ehFBPMpLjmKJLo04G6+SNNImOvxpwB16Ubdh3sKCNQjgEXXwQZirSPkZY0IlJJRDV1utvC8VtthWu6c=
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment