Skip to content

Commit 72ea882

Browse files
committed
chore: add tests for ci on 1.x
1 parent 5bcaf99 commit 72ea882

3 files changed

Lines changed: 60 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- master
6+
- 1.x
67
env:
78
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89
jobs:
@@ -26,7 +27,7 @@ jobs:
2627
git config user.email "${{ github.actor }}@users.noreply.github.com"
2728
git add dist
2829
git commit -m "chore: build dist files" || true
29-
git push origin master
30+
git push origin "${{ github.ref_name }}"
3031
git fetch origin
3132
- name: Install semantic release
3233
shell: bash

.github/workflows/run_tests.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
- '!master'
7+
- '!1.x'
8+
pull_request:
9+
branches:
10+
- '**'
11+
jobs:
12+
commit-lint:
13+
name: Lint commit
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: wagoid/commitlint-github-action@v1
22+
lint:
23+
name: "Lint"
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
- name: "Setup node"
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
- name: "Install dependencies"
34+
run: |
35+
npm ci
36+
shell: bash
37+
- name: "Lint infrastructure"
38+
run: |
39+
npm run lint
40+
shell: bash
41+
- name: "Run prettier in test mode"
42+
run: |
43+
npm run prettier:check
44+
shell: bash
45+
lock-diff:
46+
name: Lock diff
47+
runs-on: ubuntu-latest
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
- name: Show lock diff
54+
uses: pixelfusion/actions/package-diff@v1

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"version": "1.8.0",
44
"description": "AWS CDK scripts",
55
"scripts": {
6-
"build": "tsc"
6+
"build": "tsc",
7+
"lint": "eslint ./src/**/*",
8+
"prettier": "prettier --write ./src/**/*",
9+
"prettier:check": "prettier --check ./src/**/*"
710
},
811
"repository": {
912
"type": "git",

0 commit comments

Comments
 (0)