Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve github actions setup #24

Merged
merged 6 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/autopublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
MONGOMS_DISABLE_POSTINSTALL: true
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand All @@ -19,7 +21,7 @@ jobs:
with:
bun-version: 1.0.20

- run: HUSKY=0 bun install
- run: HUSKY=0 bun install --concurrent-scripts 1
env:
HUSKY: 0

Expand Down
61 changes: 32 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,7 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
cache-warmer:
strategy:
fail-fast: false
max-parallel: 10
matrix:
bun-version: [1.0.20, 1.0.19]
os: [ubuntu-latest, macos-latest] # os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}

- run: bun install
# This workflow contains a single job called "build"
test:
needs: cache-warmer
strategy:
fail-fast: false
max-parallel: 10
Expand All @@ -45,19 +27,26 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
MONGOMS_PREFER_GLOBAL_PATH: true
MONGOMS_VERSION: 7.0.2

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- uses: actions/cache@v3
id: cache-mongodb-binaries
name: Cache MongoDB binaries
with:
key: ${{ matrix.os }}-mongodb-${{ matrix.bun-version }}-${{ env.MONGOMS_VERSION }}
path: ~/.cache/mongodb-binaries

- uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}

- run: bun install
- run: bun install --concurrent-scripts 1

- name: Test
run: bun run test-recursive
Expand All @@ -66,7 +55,6 @@ jobs:
PUBLIC_KEY: ${{ secrets.TEST_PUBLIC_KEY }}

test-supabase:
needs: cache-warmer
strategy:
fail-fast: false
max-parallel: 10
Expand All @@ -75,6 +63,11 @@ jobs:
os: [ubuntu-latest, macos-latest] # os: [ubuntu-latest, windows-latest, macos-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
MONGOMS_PREFER_GLOBAL_PATH: true
MONGOMS_VERSION: 7.0.2
timeout-minutes: 10
# disable for now - since it for some reason fails on CI
if: false
Expand All @@ -84,11 +77,18 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- uses: actions/cache@v3
id: cache-mongodb-binaries
name: Cache MongoDB binaries
with:
key: ${{ matrix.os }}-mongodb-${{ matrix.bun-version }}-${{ env.MONGOMS_VERSION }}
path: ~/.cache/mongodb-binaries

- uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}

- run: bun install
- run: bun install --concurrent-scripts 1

- uses: supabase/setup-cli@v1

Expand All @@ -100,7 +100,6 @@ jobs:
working-directory: ./packages/supabase

typecheck:
needs: cache-warmer
strategy:
fail-fast: false
max-parallel: 10
Expand All @@ -110,6 +109,8 @@ jobs:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
MONGOMS_DISABLE_POSTINSTALL: true

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -121,13 +122,12 @@ jobs:
with:
bun-version: ${{ matrix.bun-version }}

- run: bun install
- run: bun install --concurrent-scripts 1

- name: Typecheck
run: bun run typecheck

lint:
needs: cache-warmer
strategy:
fail-fast: false
max-parallel: 10
Expand All @@ -137,6 +137,8 @@ jobs:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
MONGOMS_DISABLE_POSTINSTALL: true

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -148,13 +150,12 @@ jobs:
with:
bun-version: ${{ matrix.bun-version }}

- run: bun install
- run: bun install --concurrent-scripts 1

- name: Lint
run: bun run lint

codegen:
needs: cache-warmer
strategy:
fail-fast: false
max-parallel: 10
Expand All @@ -164,6 +165,8 @@ jobs:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
MONGOMS_DISABLE_POSTINSTALL: true

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -174,6 +177,6 @@ jobs:
with:
bun-version: ${{ matrix.bun-version }}

- run: bun install
- run: bun install --concurrent-scripts 1

- run: bun run graphql-codegen
1 change: 0 additions & 1 deletion apps/supplement-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"scripts": {
"dev": "docker-compose up -d && MONGO_URL=mongodb://localhost:27017/supplement-db NODE_ENV=development bun --hot app.ts",
"lint": "eslint .",
"lint-quiet": "eslint . --quiet",
"typecheck": "tsc --noEmit",
"graphql-codegen": "graphql-codegen"
},
Expand Down
6 changes: 3 additions & 3 deletions apps/todo-app-with-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"dependencies": {
"@expo/webpack-config": "^18.1.3",
"@urql/storage-rn": "^1.0.3",
"expo": "~49.0.21",
"expo": "^49.0.21",
"expo-status-bar": "~1.7.1",
"graphql": "^16.8.1",
"react": "18.2.0",
"react-native": "0.72.3",
"react-native-web": "~0.19.6",
"react-native": "0.72.4",
"react-native-web": "~0.19.8",
"zemble-plugin-auth-anonymous-expo": "workspace:*",
"zemble-plugin-auth-expo": "workspace:*",
"zemble-plugin-todo-ui": "workspace:*"
Expand Down
Binary file modified bun.lockb
Binary file not shown.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"reinstall-with-nuked-lockfile": "rm -rf node_modules/ && rm bun.lockb && find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + && bun install --force",
"git-nuke": "git clean -Xdf",
"clean": "find . -type f \\( -name \"*.mjs\" -o -name \"*.d.mts\" -o -name \"*.d.ts\" \\) -not -path \"./node_modules/*\" -delete",
"upgrade-interactive": "bunx npm-check-updates -ws --root --format group -i"
"upgrade-interactive": "bunx npm-check-updates -ws --root --format group -i",
"fix-dependencies": "bunx check-dependency-version-consistency --fix"
},
"trustedDependencies": [
"supabase",
"mongodb-memory-server",
"mongodb-memory-server-core"
"mongodb-memory-server"
],
"keywords": [
"zemble",
Expand Down Expand Up @@ -53,9 +53,10 @@
"@graphql-eslint/eslint-plugin": "^3.20.1",
"@graphql-typed-document-node/core": "^3.2.0",
"@tsconfig/bun": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@types/bun": "latest",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"check-dependency-version-consistency": "^4.1.0",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
Expand All @@ -71,7 +72,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-react-native-a11y": "^3.3.0",
"eslint-plugin-unicorn": "^48.0.1",
"eslint-plugin-unicorn": "^50.0.1",
"eslint-plugin-yml": "^1.11.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/anonymous-auth-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"expo": "~49.0.21",
"expo": "^49.0.21",
"graphql": "^16.8.1",
"react": "18.2.0",
"react-native": "0.72.3",
"react-native": "0.72.4",
"zemble-plugin-auth-expo": "workspace:*",
"zemble-plugin-urql-expo": "workspace:*",
"urql": "^4.0.6"
Expand Down
6 changes: 3 additions & 3 deletions packages/auth-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.21.0",
"expo": "~49.0.21",
"@react-native-async-storage/async-storage": "^1.21.0",
"expo": "^49.0.21",
"react": "18.2.0",
"react-native": "0.72.3"
"react-native": "0.72.4"
},
"devDependencies": {
"@babel/core": "^7.23.6",
Expand Down
4 changes: 0 additions & 4 deletions packages/cms-users/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
"zemble-plugin-kv": "workspace:*",
"@zemble/mongodb": "workspace:*"
},
"trustedDependencies": [
"mongodb-memory-server",
"mongodb-memory-server-core"
],
"devDependencies": {
"mongodb-memory-server": "9"
}
Expand Down
4 changes: 0 additions & 4 deletions packages/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
"papr": "^15.0.0",
"zemble-plugin-auth": "workspace:*"
},
"trustedDependencies": [
"mongodb-memory-server",
"mongodb-memory-server-core"
],
"devDependencies": {
"mongodb-memory-server": "9",
"type-fest": "^4.8.3"
Expand Down
3 changes: 1 addition & 2 deletions packages/supabase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"zemble-plugin",
"@zemble"
],
"trustedDependencies": [ "supabase" ],
"dependencies": {
"@zemble/core": "workspace:*",
"@zemble/bun": "workspace:*",
Expand All @@ -28,7 +27,7 @@
},
"devDependencies": {
"@types/bun": "latest",
"supabase": "^1.123.4",
"supabase": "^1.127.3",
"@graphql-codegen/add": "^5.0.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/todo-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.21.0",
"expo": "~49.0.21",
"@react-native-async-storage/async-storage": "^1.21.0",
"expo": "^49.0.21",
"expo-status-bar": "~1.7.1",
"graphql": "^16.8.1",
"react": "18.2.0",
"react-native": "0.72.3",
"react-native": "0.72.4",
"zemble-plugin-auth-anonymous-expo": "workspace:*",
"zemble-plugin-auth-expo": "workspace:*",
"urql": "^4.0.6"
Expand Down
4 changes: 2 additions & 2 deletions packages/urql-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"expo": "~49.0.21",
"expo": "^49.0.21",
"graphql": "^16.8.1",
"react": "18.2.0",
"react-native": "0.72.3",
"react-native": "0.72.4",
"zemble-plugin-auth-expo": "workspace:*",
"urql": "^4.0.6"
},
Expand Down
Loading