Dedicated test workflow to run on PRs (#172)

This commit is contained in:
Matt (IPv4) Cowley
2020-09-26 11:10:44 +01:00
committed by GitHub
parent 446775978f
commit 958f67c802
5 changed files with 68 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
name: Test and Deploy to DigitalOcean Spaces
name: Test and deploy to DigitalOcean Spaces
on: push
@@ -18,11 +18,11 @@ jobs:
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: npm ci, test, and build
run: |
npm ci
npm test
npm run build
- name: Install dependencies
run: npm ci
- name: Build tool
run: npm run build
- 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

View File

@@ -1,4 +1,4 @@
name: Test and Deploy to GitHub Pages
name: Test and deploy to GitHub Pages
on:
push:
@@ -21,11 +21,14 @@ jobs:
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: npm ci, test, and build
run: |
npm ci
npm test
npm run build
- name: Install dependencies
run: npm ci
- name: Test before production
run: npm test
- name: Build tool
run: npm run build
- name: Deploy master to GitHub Pages
uses: JamesIves/github-pages-deploy-action@2.0.0

46
.github/workflows/test-workflow.yml vendored Normal file
View 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