mirror of
https://github.com/digitalocean/nginxconfig.io
synced 2024-11-10 04:24:12 +00:00
Dedicated test workflow to run on PRs (#172)
This commit is contained in:
parent
446775978f
commit
958f67c802
5 changed files with 68 additions and 16 deletions
|
@ -11,3 +11,6 @@ indent_size = 2
|
||||||
|
|
||||||
[*.json]
|
[*.json]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
|
12
.github/workflows/do-spaces-workflow.yml
vendored
12
.github/workflows/do-spaces-workflow.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Test and Deploy to DigitalOcean Spaces
|
name: Test and deploy to DigitalOcean Spaces
|
||||||
|
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
|
@ -18,11 +18,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
||||||
|
|
||||||
- name: npm ci, test, and build
|
- name: Install dependencies
|
||||||
run: |
|
run: npm ci
|
||||||
npm ci
|
|
||||||
npm test
|
- name: Build tool
|
||||||
npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Deploy commit to DigitalOcean Spaces
|
- name: Deploy commit to DigitalOcean Spaces
|
||||||
run: aws s3 sync ./dist s3://${{ secrets.SPACES_BUCKET }}/commits/nginxconfig/${{ github.sha }} --endpoint=https://${{ secrets.SPACES_REGION }}.digitaloceanspaces.com --acl public-read --content-encoding utf8
|
run: aws s3 sync ./dist s3://${{ secrets.SPACES_BUCKET }}/commits/nginxconfig/${{ github.sha }} --endpoint=https://${{ secrets.SPACES_REGION }}.digitaloceanspaces.com --acl public-read --content-encoding utf8
|
||||||
|
|
15
.github/workflows/gh-pages-workflow.yml
vendored
15
.github/workflows/gh-pages-workflow.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Test and Deploy to GitHub Pages
|
name: Test and deploy to GitHub Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -21,11 +21,14 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
||||||
|
|
||||||
- name: npm ci, test, and build
|
- name: Install dependencies
|
||||||
run: |
|
run: npm ci
|
||||||
npm ci
|
|
||||||
npm test
|
- name: Test before production
|
||||||
npm run build
|
run: npm test
|
||||||
|
|
||||||
|
- name: Build tool
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
- name: Deploy master to GitHub Pages
|
- name: Deploy master to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@2.0.0
|
uses: JamesIves/github-pages-deploy-action@2.0.0
|
||||||
|
|
46
.github/workflows/test-workflow.yml
vendored
Normal file
46
.github/workflows/test-workflow.yml
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
name: Test commit or pull request
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
eslint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
||||||
|
id: nvm
|
||||||
|
|
||||||
|
- name: Use Node.js (.nvmrc)
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Test with eslint
|
||||||
|
run: npm run test:eslint
|
||||||
|
|
||||||
|
sass-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
||||||
|
id: nvm
|
||||||
|
|
||||||
|
- name: Use Node.js (.nvmrc)
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Test with sass-lint
|
||||||
|
run: npm run test:sass-lint
|
|
@ -18,12 +18,12 @@
|
||||||
"dev:tool": "vue-cli-service serve src/nginxconfig/mount.js",
|
"dev:tool": "vue-cli-service serve src/nginxconfig/mount.js",
|
||||||
"analyze": "npm run build:tool -- --analyze",
|
"analyze": "npm run build:tool -- --analyze",
|
||||||
"deploy:spaces:comment": "do-vue comment nginxconfig",
|
"deploy:spaces:comment": "do-vue comment nginxconfig",
|
||||||
"test": "npm run test:eslint && npm run test:scss",
|
"test": "npm run test:eslint && npm run test:sass-lint",
|
||||||
"test:fix": "npm run test:eslint:fix && npm run test:scss:fix",
|
"test:fix": "npm run test:eslint:fix && npm run test:sass-lint:fix",
|
||||||
"test:eslint": "eslint 'src/**/*.{js,vue}'",
|
"test:eslint": "eslint 'src/**/*.{js,vue}'",
|
||||||
"test:eslint:fix": "npm run test:eslint -- --fix",
|
"test:eslint:fix": "npm run test:eslint -- --fix",
|
||||||
"test:scss": "sass-lint 'src/**/*.scss' --verbose --no-exit --config .sasslintrc",
|
"test:sass-lint": "sass-lint 'src/**/*.scss' --verbose --no-exit --config .sasslintrc",
|
||||||
"test:scss:fix": "sass-lint-auto-fix 'src/**/*.scss'"
|
"test:sass-lint:fix": "sass-lint-auto-fix 'src/**/*.scss'"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in a new issue