Skip to content

Commit 4c25bb8

Browse files
authored
improve gh action (#495)
1 parent c6364d3 commit 4c25bb8

File tree

8 files changed

+50
-49
lines changed

8 files changed

+50
-49
lines changed

.github/workflows/build.yaml

-22
This file was deleted.

.github/workflows/main.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build
2+
on: [push]
3+
4+
env:
5+
CI_BUILD_NUM: ${{ github.run_id }}
6+
CI_BRANCH: ${{ github.ref_name }}
7+
8+
jobs:
9+
test:
10+
name: Test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Use Node.js 20.x
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
- run: npm ci
19+
- run: npm test
20+
- uses: codecov/codecov-action@v3
21+
with:
22+
token: ${{ secrets.CODECOV_TOKEN }}
23+
- name: Semantic Release (Dry Run)
24+
run: npm run semantic-release-dry
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
28+
29+
release:
30+
name: Release
31+
runs-on: ubuntu-latest
32+
needs: test
33+
if: github.ref == 'refs/heads/main'
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Use Node.js 20.x
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '20.x'
40+
- run: npm ci
41+
- run: npm run semantic-release
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
45+
CORALOGIX_TAGGER_API_KEY: ${{ secrets.CORALOGIX_TAGGER_API_KEY }}

.github/workflows/release.yaml

-23
This file was deleted.

.github/workflows/semver-check.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Semantic Release
12
on:
23
push:
34
branches-ignore:

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ This package contains the common code for `helix-pipeline-service` and `helix-cl
88

99
## Status
1010
[![codecov](https://img.shields.io/codecov/c/github/adobe/helix-html-pipeline.svg)](https://codecov.io/gh/adobe/helix-html-pipeline)
11-
[![CircleCI](https://img.shields.io/circleci/project/github/adobe/helix-html-pipeline.svg)](https://circleci.com/gh/adobe/helix-html-pipeline)
11+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/adobe/helix-html-pipeline/main.yaml)
1212
[![GitHub license](https://img.shields.io/github/license/adobe/helix-html-pipeline.svg)](https://github.com/adobe/helix-html-pipeline/blob/master/LICENSE.txt)
1313
[![GitHub issues](https://img.shields.io/github/issues/adobe/helix-html-pipeline.svg)](https://github.com/adobe/helix-html-pipeline/issues)
14-
[![LGTM Code Quality Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/adobe/helix-html-pipeline.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/adobe/helix-html-pipeline)
1514
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
1615

1716
## Installation

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"test": "c8 mocha",
1717
"lint": "eslint .",
1818
"semantic-release": "semantic-release",
19+
"semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
1920
"prepare": "husky install"
2021
},
2122
"repository": {

test/json-pipe.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ describe('JSON Pipe Test', () => {
536536
});
537537
const resp = await jsonPipe(state, new PipelineRequest('https://json-filter.com/?limit=5'));
538538
assert.strictEqual(resp.status, 502);
539-
assert.strictEqual(resp.headers.get('x-error'), 'failed to parse json: Unexpected token h in JSON at position 1');
539+
assert.strictEqual(resp.headers.get('x-error'), 'failed to parse json: Unexpected token \'h\', "this is no json" is not valid JSON');
540540
});
541541

542542
it('serves multi-sheet data for multi-sheet query', async () => {

test/steps/fetch-mapped-metadata.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('Fetch Mapped Metadata', () => {
5353
headers: new Map(),
5454
}),
5555
});
56-
await assert.rejects(promise, new PipelineStatusError(500, 'failed parsing of /mapped/metadata.json: Unexpected token h in JSON at position 1'));
56+
await assert.rejects(promise, new PipelineStatusError(500, 'failed parsing of /mapped/metadata.json: Unexpected token \'h\', "this is no json!" is not valid JSON'));
5757
});
5858

5959
it('throws error on metadata with no data array', async () => {

0 commit comments

Comments
 (0)