Azure Pipelines -> GitHub Actions
- Update CodeCov CI provider URL - Remove Support for Azure Pipelines - Add support for GitHub Actions - Stop generating redundent reports - Update @pegjs/publish-devmaster
parent
cf022429bb
commit
61377b1bd7
@ -0,0 +1,87 @@
|
||||
name: Github Actions
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 10.x
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --global yarn
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --ignore-engines
|
||||
|
||||
- name: Lint JavaScript files using ESLint
|
||||
run: yarn lint
|
||||
|
||||
ci:
|
||||
name: Test
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [ 6.x, 8.x, 10.x, 12.x ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --global yarn
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --ignore-engines
|
||||
|
||||
- name: Run tests
|
||||
run: yarn test
|
||||
|
||||
- name: Publish code coverage results
|
||||
run: yarn coverage
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
cd:
|
||||
name: Publish
|
||||
needs: [ lint, ci ]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 10.x
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --global yarn
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --ignore-engines
|
||||
|
||||
- name: 'Build "pegjs/dist/*.js" files'
|
||||
run: yarn build-dist
|
||||
|
||||
- name: Publish pegjs@dev to NPM
|
||||
run: node tools/publish-dev
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
@ -1,61 +0,0 @@
|
||||
name: $(BuildID)
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: apt
|
||||
type: github
|
||||
name: futagoza/apt
|
||||
endpoint: futagoza
|
||||
|
||||
variables:
|
||||
- group: 'env-variables'
|
||||
|
||||
jobs:
|
||||
|
||||
- template: eslint.yml@apt
|
||||
parameters:
|
||||
install_scope: 'yarn'
|
||||
job_script: 'yarn lint'
|
||||
|
||||
- template: node-test.yml@apt
|
||||
parameters:
|
||||
npm_test: False
|
||||
beforeEach:
|
||||
- script: |
|
||||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
||||
chmod +x ./cc-test-reporter
|
||||
displayName: 'Download Code Climate Test Reporter'
|
||||
afterEach:
|
||||
- script: |
|
||||
./cc-test-reporter before-build
|
||||
yarn test 2> /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo '"yarn test" passed, publishing to code climate.'
|
||||
./cc-test-reporter after-build --exit-code 0
|
||||
echo 'Publishing code coverage results to coveralls.io'
|
||||
yarn coverage
|
||||
exit 0
|
||||
else
|
||||
echo '"yarn test" failed, publishing to code climate.'
|
||||
./cc-test-reporter after-build --exit-code 1
|
||||
exit 1
|
||||
fi
|
||||
displayName: 'mocha > codeclimate & coveralls'
|
||||
env:
|
||||
CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
|
||||
CODECOV_TOKEN: $(CODECOV_TOKEN)
|
||||
publish_test_results_to_pipelines: True
|
||||
publish_code_coverage_to_pipelines: True
|
||||
|
||||
- template: node.yml@apt
|
||||
parameters:
|
||||
name: 'Publish pegjs@dev'
|
||||
actions:
|
||||
- script: npm run build-dist
|
||||
displayName: 'Build "pegjs/dist/*.js" files'
|
||||
- script: node tools/publish-dev
|
||||
displayName: 'Publish to NPM'
|
||||
env:
|
||||
NPM_TOKEN: $(NPM_CI_TOKEN)
|
||||
BUILD_REASON: $(variables['Build.Reason'])
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"reporterEnabled": "spec, mocha-junit-reporter",
|
||||
"mochaJunitReporterReporterOptions": {
|
||||
"mochaFile": "coverage/junit.xml"
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
--recursive
|
||||
--reporter mocha-multi-reporters
|
||||
--reporter-options configFile=test/config.json
|
||||
--reporter spec
|
||||
{packages,test}/**/*.{spec,test}.js
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@pegjs/publish-dev",
|
||||
"version": "2.0.0",
|
||||
"version": "2.2.0",
|
||||
"private": true
|
||||
}
|
||||
|
Loading…
Reference in New Issue