Skip to content

Commit

Permalink
Merge pull request #158 from Netflix/add-build-release-workflow
Browse files Browse the repository at this point in the history
introduce build-release workflow
  • Loading branch information
jasonk000 committed Apr 21, 2022
2 parents 70ea947 + 1572e42 commit cc9e953
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Release

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install Node.js dependencies
run: npm install
- name: Build with webpack
run: npm run webpack
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Lint with flake8
run: |
flake8 app
- name: Test with pytest
run: |
pytest
- name: Create tarball
if: startsWith(github.ref, 'refs/tags/')
run: |
tar -zcvf dist.tar.gz ./app ./requirements.txt ./run.py
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist.tar.gz
Empty file added tests/__init__.py
Empty file.

0 comments on commit cc9e953

Please sign in to comment.