Skip to content

Commit

Permalink
chore: add basic CI workflows (#4)
Browse files Browse the repository at this point in the history
* refactor: use bun and clean up package scripts

* chore: add basic ci workflows
  • Loading branch information
byCedric authored Mar 15, 2024
1 parent 83c3226 commit 69ed6b2
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 16,628 deletions.
38 changes: 38 additions & 0 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup project
description: Prepare the project for any CI action

inputs:
bun-version:
description: Version of Bun to install
default: 1.x

node-version:
description: Version of Node to install
default: 20.x

with-webui:
description: If the setup should prepare the web UI
type: boolean

runs:
using: composite
steps:
- name: 🏗 Setup Node
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ inputs.bun-version }}

- name: 🏗 Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: 📦 Install dependencies
run: bun install
shell: bash

- name: 📦 Install webui dependencies
if: ${{ inputs.with-webui == 'true' }}
run: bun install
working-directory: webui
shell: bash
43 changes: 43 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: review

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup project
uses: ./.github/actions/setup-project

- name: 🚨 Lint core
run: bun run lint -- --max-warnings 0

build:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup project
uses: ./.github/actions/setup-project
with:
with-webui: true

- name: 👷 Build core
run: bun run build

- name: 👷 Build webui
run: bun run build
working-directory: webui
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

# dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
package-lock.json

# Expo
.expo/
Expand Down
Binary file added bun.lockb
Binary file not shown.
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@
},
"scripts": {
"lint": "eslint . --ext js,ts,tsx",
"build": "CI=true expo-module build",
"build:all": "expo-module prepare && cd webui && npx expo export -p web --output-dir ../dist",
"watch": "expo-module build",
"clean": "expo-module clean",
"web:dev": "cd webui && npx expo start -w",
"web:export": "cd webui && npx expo export -p web --output-dir ../dist"
"build": "expo-module build",
"clean": "expo-module clean"
},
"license": "MIT",
"dependencies": {
Expand Down Expand Up @@ -73,7 +69,8 @@
"ignorePatterns": [
"build",
"dist",
"node_modules"
"node_modules",
"webui/expo-env.d.ts"
],
"rules": {
"@typescript-eslint/no-unused-vars": [
Expand Down
Binary file added webui/bun.lockb
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions webui/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"private": true,
"name": "metro-bundle-plugin-webui",
"version": "0.0.1-private",
"main": "src/index.ts",
"scripts": {
"start": "EXPO_METRO_BUNDLE_STATS_FILE=\"/Users/cedric/Desktop/test-metro-bundle-inspect/.expo/stats.json\" expo start",
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"build": "EXPO_USE_METRO_WORKSPACE_ROOT=false expo export --platform web"
"build": "expo export --platform web"
},
"dependencies": {
"@expo/styleguide": "^8.2.2",
Expand All @@ -24,7 +25,7 @@
"echarts-for-react": "^3.0.2",
"expo": "~50.0.6",
"expo-linking": "~6.2.2",
"expo-router": "file:../../../expo/expo/packages/expo-router",
"expo-router": "./expo-router-a6329839072067d010b6233b0f57abf0ece80d69.tgz",
"expo-status-bar": "~1.11.1",
"lucide-react": "^0.336.0",
"nativewind": "^4.0.36",
Expand All @@ -45,6 +46,5 @@
"@types/picomatch": "^2.3.3",
"@types/react": "~18.2.45",
"typescript": "^5.3.0"
},
"private": true
}
}
Loading

0 comments on commit 69ed6b2

Please sign in to comment.