Add linter and minor bug fixes (#107)
This commit is contained in:
20
.github/workflows/workflow.yml
vendored
20
.github/workflows/workflow.yml
vendored
@@ -24,11 +24,27 @@ jobs:
|
||||
- name: Run tests
|
||||
run: docker run --workdir=/metrics --entrypoint="" lowlighter/metrics:${{ github.head_ref || 'master' }} npm test
|
||||
|
||||
# Run linter to ensure new code respect coding rules
|
||||
lint:
|
||||
name: Apply linter
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup NodeJS
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 15
|
||||
- name: Setup metrics
|
||||
run: npm ci
|
||||
- name: Run linter
|
||||
run: npm run linter
|
||||
|
||||
# Run CodeQL on branch
|
||||
analyze:
|
||||
name: Analyze code
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
needs: [ lint ]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
@@ -44,7 +60,7 @@ jobs:
|
||||
docker-master:
|
||||
name: Publish master to GitHub registry
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
needs: [ build, lint ]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
|
||||
Reference in New Issue
Block a user