summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-03-26 13:45:53 -0600
committerGravatar GitHub <noreply@github.com> 2021-03-26 13:45:53 -0600
commit7def0463b1688aa446665f0e5d4a1bc77ccb8dd3 (patch)
tree2e5053dabb9aca41418a7dc91fd786173d0d4585
parentc7b03776eee9631aa02f106e3af307fb354d753c (diff)
downloadastro-7def0463b1688aa446665f0e5d4a1bc77ccb8dd3.tar.gz
astro-7def0463b1688aa446665f0e5d4a1bc77ccb8dd3.tar.zst
astro-7def0463b1688aa446665f0e5d4a1bc77ccb8dd3.zip
Add Auto-format action (#33)
-rw-r--r--.github/workflows/format.yml28
-rw-r--r--.github/workflows/nodejs.yml33
-rw-r--r--package.json2
3 files changed, 45 insertions, 18 deletions
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 000000000..b08505e01
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,28 @@
+name: 'Format Code'
+
+on:
+ push:
+ branches:
+ - main
+
+env:
+ node_version: 14
+
+jobs:
+ format:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: ${{ github.head_ref }}
+ - uses: actions/setup-node@v1
+ with:
+ node-version: ${{ env.node_version }}
+ - run: npm ci
+ - run: npm run format
+ - name: Commit changes
+ uses: stefanzweifel/git-auto-commit-action@v4
+ with:
+ commit_message: '[ci] npm run format'
+ branch: ${{ github.head_ref }}
+ push_options: --force
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index 1890b86fe..0808ce599 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -3,8 +3,7 @@ name: Node CI
on: [push]
jobs:
- build:
-
+ test:
runs-on: ubuntu-latest
strategy:
@@ -12,19 +11,19 @@ jobs:
node-version: [14.x]
steps:
- - uses: actions/checkout@v1
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - name: npm install, build, and test
- run: |
- cd examples/snowpack
- npm ci
- cd ../..
+ - uses: actions/checkout@v1
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: npm install, build, and test
+ run: |
+ cd examples/snowpack
+ npm ci
+ cd ../..
- npm ci
- npm run build
- npm test
- env:
- CI: true \ No newline at end of file
+ npm ci
+ npm run build
+ npm test
+ env:
+ CI: true
diff --git a/package.json b/package.json
index 83fd7b9cd..0b5180136 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"build": "tsc",
"dev": "tsc --watch",
"lint": "eslint 'src/**/*.{js,ts}'",
- "format": "prettier -w 'src/**/*.{js,ts}'",
+ "format": "prettier -w '{src,test}/**/*.{js,ts}'",
"test": "uvu test -i fixtures -i test-utils.js",
"watch:extension": "cd vscode && npm run watch"
},