Skip to content

Commit 50fcd20

Browse files
authored
Merge pull request #32 from citation-file-format/ci-workflows
Ci workflows
2 parents 0e1ff81 + c703dd5 commit 50fcd20

7 files changed

Lines changed: 83 additions & 23 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
49

510
jobs:
11+
612
build:
713

814
runs-on: ubuntu-latest
@@ -19,7 +25,9 @@ jobs:
1925
with:
2026
node-version: ${{ matrix.node-version }}
2127
cache: 'npm'
22-
- run: npm clean-install
23-
- run: npm run build
28+
- name: Run npm clean-install
29+
run: npm clean-install
30+
- name: Run build
31+
run: npm run build
2432

2533

.github/workflows/lint.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
49

510
jobs:
6-
build:
11+
12+
lint:
713

814
runs-on: ubuntu-latest
915

@@ -19,5 +25,7 @@ jobs:
1925
with:
2026
node-version: ${{ matrix.node-version }}
2127
cache: 'npm'
22-
- run: npm clean-install
23-
- run: npm run lint
28+
- name: Run npm clean-install
29+
run: npm clean-install
30+
- name: Run linting
31+
run: npm run lint

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
9+
10+
jobs:
11+
12+
test:
13+
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [12.x, 14.x, 16.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
- name: Run npm clean-install
29+
run: npm clean-install
30+
- name: Run unit tests
31+
run: npm run test:unit:ci
32+
33+

README.dev.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ The notes about technology choices, design, personas can be found in [project-do
1111
```shell
1212
# clone this repository
1313
git clone https://github.com/citation-file-format/cffinit
14-
1514
# change directory
1615
cd cffinit
1716
```
@@ -21,7 +20,7 @@ cd cffinit
2120
The command below will install dependencies
2221

2322
```shell
24-
npm install
23+
npm clean-install
2524
```
2625

2726
## start the development server
@@ -60,7 +59,7 @@ npx husky install
6059

6160
## Tests
6261

63-
We use Jest for unit tests. To run unit tests (`src/**/*.jest.spec.ts`)
62+
We use Jest for unit tests. To run unit tests (`test/jest/__tests__/**/*.jest.spec.ts`)
6463

6564
You can run the test with
6665

src/pages/Start.vue

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
<template>
22
<div class="window-height window-width row justify-center items-center">
3-
<q-card>
4-
<q-card-title><h1>Start Page</h1></q-card-title>
5-
<q-card-main>
3+
<q-card
4+
dark
5+
bordered
6+
class="bg-grey-9 my-card"
7+
>
8+
<q-card-section>
9+
<div class="text-h6">
10+
Start Page
11+
</div>
12+
<div class="text-subtitle2">
13+
by John Doe
14+
</div>
15+
</q-card-section>
16+
17+
<q-separator
18+
dark
19+
inset
20+
/>
21+
22+
<q-card-section>
623
<p
7-
v-for="n in 10"
24+
v-for="n in 5"
825
:key="n"
926
>
1027
Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugit nihil praesentium molestias a adipisci, dolore vitae odit, quidem consequatur optio voluptates asperiores pariatur eos numquam rerum delectus commodi perferendis voluptate?
1128
</p>
12-
</q-card-main>
13-
14-
<q-card-separator />
15-
16-
<q-card-actions align="right">
1729
<q-btn
1830
color="grey-6"
19-
label="Continue"
31+
label="Get started"
2032
to="/1"
2133
/>
22-
</q-card-actions>
34+
</q-card-section>
2335
</q-card>
2436
</div>
2537
</template>

src/pages/Start.jest.spec.ts renamed to test/jest/__tests__/pages/Start.jest.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it } from '@jest/globals'
22
import { installQuasarPlugin } from '@quasar/quasar-app-extension-testing-unit-jest'
33
import { shallowMount, VueWrapper } from '@vue/test-utils'
44

5-
import Start from './Start.vue'
5+
import Start from '../../../../src/pages/Start.vue'
66

77
// Specify here Quasar config you'll need to test your component
88
installQuasarPlugin()

src/store/step.jest.spec.ts renamed to test/jest/__tests__/store/step.jest.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { beforeEach, describe, expect, it } from '@jest/globals'
22
import * as vue from 'vue'
3-
import { useStep } from './step'
3+
import { useStep } from '../../../../src/store/step'
44

55
describe('useStep', () => {
66
let step: {

0 commit comments

Comments
 (0)