Skip to content

chore: create build work added #62

chore: create build work added

chore: create build work added #62

Workflow file for this run

name: CI
# Controls when the workflow will run
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
# Prevent duplicate workflows from running
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Static tests don't involve any logic or context.
# They are just a set of tests that can detect if we are not introducing any faulty code.
static-test:
name: πŸ”¬ Static tests
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: βŽ” Setup Node
uses: actions/setup-node@v3
with:
cache: "npm"
- name: 🟨 Setup Python
uses: actions/setup-python@v3
- name: πŸ“¦ Install Node dependencies
run: npm install
# Unit tests are tests that are not dependent on any external service.
# Usually, they are tests that are testing the logic of a specific function or component.
unit-test:
needs: [static-test]
name: 🚦 Unit tests
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: βŽ” Setup Node
uses: actions/setup-node@v3
with:
cache: "npm"
- name: 🟨 Setup Python
uses: actions/setup-python@v3
- name: πŸ“¦ Install dependencies
run: npm install
- name: 🚦 Run unit tests
run: npm test
# Integration tests are tests that are dependent on external services.
integration-test:
needs: [static-test]
name: πŸš₯ Integration tests
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: βŽ” Setup Node
uses: actions/setup-node@v3
with:
cache: "npm"
- name: 🟨 Setup Python
uses: actions/setup-python@v3
- name: πŸ“¦ Install dependencies
run: npm install
# - name: 🐳 Docker compose
# run:
# docker-compose up -d && sleep 3 && pnpm prisma migrate reset --force
# --skip-seed
- name: 🚦 Run integration tests
run: npm test
# Create Build
build:
needs: [static-test]
name: πŸ—οΈ Build
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: βŽ” Setup Node
uses: actions/setup-node@v3
with:
cache: "npm"
- name: 🟨 Setup Python
uses: actions/setup-python@v3
- name: πŸ“¦ Install dependencies
run: npm install
- name: πŸ—οΈ Build
run: npm run build
- name: πŸ“¦ Electron Package
run: npx electron-packager . LinguifAI --platform=win32 --arch=x64 --out=dist
- name: πŸ“¦ Upload Artifact
uses: actions/upload-artifact@v2
with:
name: LinguifAI
path: dist