Skip to content

Commit 40531cb

Browse files
committed
ci: setup build ci
1 parent cc76068 commit 40531cb

File tree

6 files changed

+11998
-7
lines changed

6 files changed

+11998
-7
lines changed

.github/workflows/build.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build
2+
3+
env:
4+
NX_BRANCH: ${{ github.event.number || github.ref_name }}
5+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
6+
7+
on:
8+
push:
9+
branches: [ "main" ]
10+
pull_request:
11+
branches: [ "main" ]
12+
13+
jobs:
14+
build:
15+
name: Build affected projects
16+
needs: lint
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: lts/*
27+
cache: 'yarn'
28+
- uses: nrwl/nx-set-shas@v3
29+
- name: Setup global dependencies
30+
run: npm i -g yarn
31+
- name: yarn install
32+
run: yarn
33+
- name: Build.all affected
34+
run: yarn nx affected --target=build --exclude nativescript-demo-ng

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ packages/angular/dist
4545
Thumbs.db
4646

4747
.angular
48+
/.env

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
npx lint-staged --allow-empty --relative

nx.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"npmScope": "nativescript",
33
"affected": {
4-
"defaultBase": "master"
4+
"defaultBase": "main"
55
},
66
"implicitDependencies": {
77
"workspace.json": "*",
@@ -16,13 +16,14 @@
1616
},
1717
"tasksRunnerOptions": {
1818
"default": {
19-
"runner": "nx/tasks-runners/default",
19+
"runner": "@nrwl/nx-cloud",
2020
"options": {
2121
"useDaemonProcess": false,
2222
"cacheableOperations": ["build", "lint", "test", "e2e"],
2323
"canTrackAnalytics": false,
2424
"showUsageWarnings": true,
25-
"parallel": 1
25+
"parallel": 2,
26+
"accessToken": "NWJjY2UzMjctM2Q2Yy00ODZlLWExYjktNzE3YTRmMzRmMWQwfHJlYWQ="
2627
}
2728
}
2829
},

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@nativescript/core": "~8.3.4",
4747
"@nativescript/theme": "~3.0.2",
4848
"@ngx-translate/core": "~14.0.0",
49+
"@nrwl/nx-cloud": "^15.0.2",
4950
"nativescript-ngx-fonticon": "~7.0.0",
5051
"rxjs": "^7.5.6",
5152
"zone.js": "~0.11.8"
@@ -112,9 +113,8 @@
112113
"framework": "angular"
113114
},
114115
"lint-staged": {
115-
"**/*.{js,ts,scss,html,json}": [
116-
"prettier --write",
117-
"git add"
116+
"**/*.{js,ts,scss,json,html}": [
117+
"nx format:write --files"
118118
]
119119
}
120120
}

0 commit comments

Comments
 (0)