feat: Minimal Hugging Face Image Classification Pipeline #4096
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- develop | |
env: | |
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
DISPLAY: :0 | |
jobs: | |
code-style-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Format dependencies | |
run: pip3 install black && npm i | |
- name: Run formatting check | |
run: npm run check | |
python-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: pip install -r requirements.txt && npm i | |
- name: Generate manifest | |
run: | | |
python3 PYTHON/generate_manifest.py | |
python3 scripts/write_python_metadata.py | |
- name: Typescript check | |
run: npx tsc --noEmit | |
- name: pytest | |
run: | | |
cd PYTHON | |
python -m pytest --cov --cov-report=xml --ignore=nodes | |
- name: Codecov report | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: python | |
visual-tests: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.base.ref == 'main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Run Flojoy startup script | |
run: bash flojoy -c | |
# In certain Linux environments, you may experience connection errors with your X11 server. In this case, we may need to start Xvfb with the following command. | |
# This is necessary to avoid using 8-bit color depth with Xvfb, which will prevent Chrome or Electron from crashing. | |
# https://docs.cypress.io/guides/continuous-integration/introduction#Xvfb | |
- name: X server | |
run: Xvfb -screen 0 1024x768x24 :0 & | |
- name: Run e2e test | |
uses: cypress-io/github-action@v4 | |
with: | |
build: npm run build | |
start: npm run start-project | |
command: npx percy exec -- cypress run | |
browser: chrome | |
install: false | |
- name: Codecov report | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage-cy/coverage-final.json | |
flags: cypress |