2019-07-11 20:24:33 +00:00
|
|
|
name: Main workflow
|
2019-12-31 06:04:50 +00:00
|
|
|
on: [push, pull_request]
|
2019-07-11 20:24:33 +00:00
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
name: Run
|
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
operating-system: [ubuntu-latest, windows-latest]
|
2019-07-26 02:59:48 +00:00
|
|
|
steps:
|
2019-07-23 17:22:25 +00:00
|
|
|
- name: Checkout
|
2020-02-11 21:21:01 +00:00
|
|
|
uses: actions/checkout@v2
|
2019-07-23 17:22:25 +00:00
|
|
|
|
2020-02-11 21:21:01 +00:00
|
|
|
- name: Setup Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
2019-07-11 20:24:33 +00:00
|
|
|
with:
|
2020-02-11 21:21:01 +00:00
|
|
|
node-version: 12.x
|
2019-07-11 20:24:33 +00:00
|
|
|
|
|
|
|
- name: npm install
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: npm run format-check
|
|
|
|
|
|
|
|
- name: npm test
|
|
|
|
run: npm test
|
2020-02-06 20:16:41 +00:00
|
|
|
run-with-proxy:
|
|
|
|
name: Run with proxy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
squid:
|
|
|
|
image: dakale/squid
|
|
|
|
ports: ['3128:3128']
|
|
|
|
options: '--health-cmd "exit 0" --health-interval 3s'
|
|
|
|
env:
|
|
|
|
http_proxy: http://localhost:3128
|
|
|
|
https_proxy: http://localhost:3128
|
|
|
|
steps:
|
|
|
|
- name: Block non proxied traffic
|
|
|
|
run: |
|
|
|
|
echo "127.0.0.0 registry.npm.js nodejs.org github.com api.github.com download.java.net static.azul.com" | sudo tee -a /etc/hosts
|
|
|
|
- name: Checkout
|
2020-02-11 21:21:01 +00:00
|
|
|
uses: actions/checkout@v2
|
2020-02-06 20:16:41 +00:00
|
|
|
|
2020-02-11 21:21:01 +00:00
|
|
|
- name: Setup Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
2020-02-06 20:16:41 +00:00
|
|
|
with:
|
2020-02-11 21:21:01 +00:00
|
|
|
node-version: 12.x
|
2020-02-06 20:16:41 +00:00
|
|
|
|
|
|
|
- name: npm install
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: npm run format-check
|
|
|
|
|
|
|
|
- name: npm test
|
|
|
|
run: npm test
|