Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcardle committed Oct 28, 2023
1 parent b9434d2 commit ed7ed2e
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 53 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,66 @@ jobs:
- run: yarn build

- name: Upload dist directory
- name: Upload djangobuilder4 dist directory
uses: actions/upload-artifact@v1
with:
name: dist
path: dist

unit_tests:
name: Unit Tests
name: djangobuilder4_dist
path: ./packages/djangobuilder4/dist

- name: Upload djangobuilder.io dist directory
uses: actions/upload-artifact@v1
with:
name: djangobuilder.io_dist
path: ./packages/djangobuilder.io/dist

smoke_tests:
name: Smoke tests - djangobuilder-core
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn test:unit
- run: yarn smoketest

core_tests:
name: Core tests - djangobuilder-core
needs: [smoke_tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn coretest

test_v4:
name: Unit Tests - djangobuilder 4
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn test_4

cli_tests:
name: CLI Tests
name: CLI Tests - djangobuilder 4
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: script/run.sh
- run: packages/djangobuilder.io/script/run.sh

io_tests:
name: Unit Tests - djangobuilder.io
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn test_io

e2e_tests:
name: E2E Tests
needs: [build]
name: E2E Tests - djangobuilder.io
needs: [io_tests]
runs-on: ubuntu-latest
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
Expand All @@ -65,8 +98,8 @@ jobs:
- name: Download dist
uses: actions/download-artifact@v1
with:
name: dist
- run: export yarn ci
name: djangobuilder4_dist
- run: yarn ci
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
],
"scripts": {
"dev": "yarn --cwd packages/djangobuilder4 dev",
"build": "yarn run build_io && yarn build_4",
"build": "yarn run build_io && yarn build_v4",
"build_io": "yarn --cwd packages/djangobuilder.io build",
"build_4": "yarn --cwd packages/djangobuilder4 build",
"build_v4": "yarn --cwd packages/djangobuilder4 build",
"lint": "yarn --cwd packages/djangobuilder4 lint",
"devio": "yarn --cwd packages/djangobuilder.io dev",
"buildio": "yarn --cwd packages/djangobuilder.io build",
"smoketest": "yarn --cwd lib/djangobuilder-core run smoketest",
"coretest": "yarn --cwd lib/djangobuilder-core run test",
"test": "yarn run smoketest && yarn coretest"
"test_v4": "yarn --cwd packages/djangobuilder4 run test:unit",
"test_io": "yarn --cwd packages/djangobuilder.io run test:unit",
"test": "yarn run smoketest && yarn coretest && yarn test_v4 && yarn test_io",
"ci": "yarn --cwd packages/djangobuilder.io run ci"
}
}
16 changes: 2 additions & 14 deletions packages/djangobuilder4/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ import type {
DjangoProject,
DjangoRelationship,
} from "@djangobuilder/core";
import { useUserStore } from "./stores/user";
import { storeToRefs } from "pinia";

const userStore = useUserStore();
const { getFieldId, getRelationshipId } =
storeToRefs(userStore);

async function updateProject(
project: DjangoProject,
Expand All @@ -39,20 +33,14 @@ async function updateField(
field: DjangoField,
args: Record<string, string | boolean | number>
) {
const fieldid = getFieldId.value(field);
if (fieldid) {
await updateDoc(doc(db, "fields", fieldid), args);
} else {
throw new Error(`No field ${field.name}`);
}
await updateDoc(doc(db, "fields", field.id), args);
}

async function updateRelationship(
relationship: DjangoRelationship,
args: Record<string, string | boolean | number>
) {
const relationshipid = getRelationshipId.value(relationship);
await updateDoc(doc(db, "relationships", relationshipid), args);
await updateDoc(doc(db, "relationships", relationship.id), args);
}

export {
Expand Down
36 changes: 13 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2023,12 +2023,7 @@
dependencies:
"@hapi/hoek" "^9.0.0"

"@sideway/formula@^3.0.0":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f"
integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==

"@sideway/formula@^3.0.1":
"@sideway/formula@^3.0.0", "@sideway/formula@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f"
integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==
Expand Down Expand Up @@ -12202,11 +12197,6 @@ uuid@^8.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==

uuid@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==

v8-compile-cache-lib@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
Expand Down Expand Up @@ -12275,18 +12265,6 @@ [email protected]:
source-map "^0.7.3"
vue-template-es2015-compiler "^1.9.1"

vite@^2.9.16:
version "2.9.16"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.16.tgz#daf7ba50f5cc37a7bf51b118ba06bc36e97898e9"
integrity sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==
dependencies:
esbuild "^0.14.27"
postcss "^8.4.13"
resolve "^1.22.0"
rollup ">=2.59.0 <2.78.0"
optionalDependencies:
fsevents "~2.3.2"

"vite@^2.9.12 || ^3.0.0-0", vite@^3.0.4:
version "3.2.5"
resolved "https://registry.yarnpkg.com/vite/-/vite-3.2.5.tgz#dee5678172a8a0ab3e547ad4148c3d547f90e86a"
Expand All @@ -12299,6 +12277,18 @@ vite@^2.9.16:
optionalDependencies:
fsevents "~2.3.2"

vite@^2.9.16:
version "2.9.16"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.16.tgz#daf7ba50f5cc37a7bf51b118ba06bc36e97898e9"
integrity sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==
dependencies:
esbuild "^0.14.27"
postcss "^8.4.13"
resolve "^1.22.0"
rollup ">=2.59.0 <2.78.0"
optionalDependencies:
fsevents "~2.3.2"

vite@^3.0.0:
version "3.2.4"
resolved "https://registry.yarnpkg.com/vite/-/vite-3.2.4.tgz#d8c7892dd4268064e04fffbe7d866207dd24166e"
Expand Down

0 comments on commit ed7ed2e

Please sign in to comment.