Skip to content

Commit

Permalink
chore: updates build
Browse files Browse the repository at this point in the history
  • Loading branch information
rustygreen committed Feb 8, 2024
1 parent 5b5e0c4 commit 972c0be
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 126 deletions.
41 changes: 30 additions & 11 deletions .github/workflows/test-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,36 @@ on:
branches:
- main
jobs:
Explore-GitHub-Actions:
Test-and-Build:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
- name: Checkout
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build:ci

- name: Test
run: npm run test:ci

- name: Archive build
if: success()
uses: actions/upload-artifact@v4
with:
name: deploy_dist
path: dist

- name: Archive code coverage result
if: success()
uses: actions/upload-artifact@v4
with:
name: deploy_coverage
path: coverage
24 changes: 2 additions & 22 deletions apps/demo/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { NxWelcomeComponent } from './nx-welcome.component';
import { RouterTestingModule } from '@angular/router/testing';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent, NxWelcomeComponent, RouterTestingModule],
}).compileComponents();
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome demo');
});

it(`should have as title 'demo'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('demo');
it('TODO: add tests', () => {
expect(1).toBe(1);
});
});

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 2 additions & 7 deletions libs/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"name": "@ng-supabase/bootstrap",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {},
"dependencies": {},
"sideEffects": false
}
10 changes: 6 additions & 4 deletions libs/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
"@angular/core": "^17.0.0",
"@angular/router": "~17.0.0",
"@angular/forms": "~17.0.0",
"rxjs": "~7.8.0",
"@supabase/supabase-js": "^2.39.1"
},
"dependencies": {},
"sideEffects": false
}
9 changes: 2 additions & 7 deletions libs/material/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"name": "@ng-supabase/material",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {},
"dependencies": {},
"sideEffects": false
}
11 changes: 7 additions & 4 deletions libs/primeng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
"@angular/core": "^17.0.0",
"primeng": "^17.3.0",
"@angular/forms": "~17.0.0",
"rxjs": "~7.8.0",
"@ng-supabase/core": "*",
"@supabase/supabase-js": "^2.39.1"
},
"dependencies": {},
"sideEffects": false
}
26 changes: 22 additions & 4 deletions libs/primeng/src/lib/login/login.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// Angular.
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

// ng-supabase.
import { SupabaseConfig, SupabaseService } from '@ng-supabase/core';

// Local.
import { LoginComponent } from './login.component';

describe('LoginComponent', () => {
Expand All @@ -8,10 +14,22 @@ describe('LoginComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [LoginComponent]
})
.compileComponents();

imports: [LoginComponent, RouterTestingModule],
providers: [
{
provide: SupabaseConfig,
useValue: new SupabaseConfig({
apiKey: 'some-key',
apiUrl: 'mock://localhost/supabase',
}),
},
{
provide: SupabaseService,
useValue: {},
},
],
}).compileComponents();

fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
22 changes: 21 additions & 1 deletion libs/primeng/src/lib/register/register.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// Angular.
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

// ng-supabase.
import { SupabaseConfig, SupabaseService } from '@ng-supabase/core';

// Local.
import { RegisterComponent } from './register.component';

describe('RegisterComponent', () => {
Expand All @@ -7,7 +14,20 @@ describe('RegisterComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [RegisterComponent],
imports: [RegisterComponent, RouterTestingModule],
providers: [
{
provide: SupabaseConfig,
useValue: new SupabaseConfig({
apiKey: 'some-key',
apiUrl: 'mock://localhost/supabase',
}),
},
{
provide: SupabaseService,
useValue: {},
},
],
}).compileComponents();

fixture = TestBed.createComponent(RegisterComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// Angular.
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

// ng-supabase.
import { SupabaseConfig, SupabaseService } from '@ng-supabase/core';

// Local.
import { ResetPasswordComponent } from './reset-password.component';

describe('ResetPasswordComponent', () => {
Expand All @@ -7,7 +14,20 @@ describe('ResetPasswordComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ResetPasswordComponent],
imports: [ResetPasswordComponent, RouterTestingModule],
providers: [
{
provide: SupabaseConfig,
useValue: new SupabaseConfig({
apiKey: 'some-key',
apiUrl: 'mock://localhost/supabase',
}),
},
{
provide: SupabaseService,
useValue: {},
},
],
}).compileComponents();

fixture = TestBed.createComponent(ResetPasswordComponent);
Expand Down
22 changes: 21 additions & 1 deletion libs/primeng/src/lib/set-password/set-password.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// Angular.
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

// ng-supabase.
import { SupabaseConfig, SupabaseService } from '@ng-supabase/core';

// Local.
import { SetPasswordComponent } from './set-password.component';

describe('SetPasswordComponent', () => {
Expand All @@ -7,7 +14,20 @@ describe('SetPasswordComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SetPasswordComponent],
imports: [SetPasswordComponent, RouterTestingModule],
providers: [
{
provide: SupabaseConfig,
useValue: new SupabaseConfig({
apiKey: 'some-key',
apiUrl: 'mock://localhost/supabase',
}),
},
{
provide: SupabaseService,
useValue: {},
},
],
}).compileComponents();

fixture = TestBed.createComponent(SetPasswordComponent);
Expand Down
22 changes: 21 additions & 1 deletion libs/primeng/src/lib/wait-message/wait-message.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// Angular.
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

// ng-supabase.
import { SupabaseConfig, SupabaseService } from '@ng-supabase/core';

// Local.
import { WaitMessageComponent } from './wait-message.component';

describe('WaitMessageComponent', () => {
Expand All @@ -7,7 +14,20 @@ describe('WaitMessageComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [WaitMessageComponent],
imports: [WaitMessageComponent, RouterTestingModule],
providers: [
{
provide: SupabaseConfig,
useValue: new SupabaseConfig({
apiKey: 'some-key',
apiUrl: 'mock://localhost/supabase',
}),
},
{
provide: SupabaseService,
useValue: {},
},
],
}).compileComponents();

fixture = TestBed.createComponent(WaitMessageComponent);
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
"serve": "nx serve",
"stylelint": "stylelint",
"start:demo": "nx serve --project=demo",
"lint:ci": "npm run lint:all",
"lint:all": "nx run-many -t lint && stylelint -- **/*.scss",
"lint:style": "stylelint -- **/*.scss",
"lint:style:fix": "stylelint -- **/*.scss --fix",
"test": "nx test",
"test:ci": "npm run test:all",
"test:all": "npm run nx -- run-many -t test",
"test:affected": "nx affected -t lint --base=main --head=HEAD --parallel=5 && stylelint -- **/*.scss --fix"
},
Expand Down

0 comments on commit 972c0be

Please sign in to comment.