Skip to content

Commit 6a51b02

Browse files
authored
Move more stuff from BK to GHA (matrix-org#2307)
* Use consistent indentation in GHA yaml files * Prefer setup-node's dep caching * Tidy up test_coverage job * Move js sdk lint ci to gha * notify react-sdk of develop merges * Name the jobs * test * Update secrets * Fixup
1 parent 47d2c06 commit 6a51b02

File tree

5 files changed

+87
-14
lines changed

5 files changed

+87
-14
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ insert_final_newline = true
2121
indent_style = space
2222
indent_size = 4
2323
trim_trailing_whitespace = true
24+
25+
[*.{yml,yaml}]
26+
indent_size = 2
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Notify Downstream Projects
2+
on:
3+
push:
4+
branches: [ develop ]
5+
jobs:
6+
notify-matrix-react-sdk:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Notify matrix-react-sdk repo that a new SDK build is on develop so it can CI against it
10+
uses: peter-evans/repository-dispatch@v1
11+
with:
12+
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
13+
repository: vector-im/element-web
14+
event-type: upstream-sdk-notify
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Static Analysis
2+
on:
3+
pull_request: { }
4+
jobs:
5+
ts_lint:
6+
name: "Typescript Syntax Check"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- uses: actions/setup-node@v3
12+
with:
13+
cache: 'yarn'
14+
15+
- name: Install Deps
16+
run: "yarn install"
17+
18+
- name: Typecheck
19+
run: "yarn run lint:types"
20+
21+
js_lint:
22+
name: "ESLint"
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- uses: actions/setup-node@v3
28+
with:
29+
cache: 'yarn'
30+
31+
- name: Install Deps
32+
run: "yarn install"
33+
34+
- name: Run Linter
35+
run: "yarn run lint:js"
36+
37+
docs:
38+
name: "JSDoc Checker"
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
43+
- uses: actions/setup-node@v3
44+
with:
45+
cache: 'yarn'
46+
47+
- name: Install Deps
48+
run: "yarn install"
49+
50+
- name: Generate Docs
51+
run: "yarn run gendoc"

.github/workflows/preview_changelog.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ on:
33
pull_request_target:
44
types: [ opened, edited, labeled ]
55
jobs:
6-
changelog:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- name: Preview Changelog
10-
uses: matrix-org/allchange@main
11-
with:
12-
ghToken: ${{ secrets.GITHUB_TOKEN }}
6+
changelog:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Preview Changelog
10+
uses: matrix-org/allchange@main
11+
with:
12+
ghToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test_coverage.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
name: Test coverage
22
on:
3-
pull_request: {}
3+
pull_request: { }
44
push:
5-
branches: [develop, main, master]
5+
branches: [ develop, main, master ]
66
jobs:
77
test-coverage:
88
runs-on: ubuntu-latest
9-
env:
10-
# This must be set for fetchdep.sh to get the right branch
11-
PR_NUMBER: ${{github.event.number}}
129
steps:
1310
- name: Checkout code
1411
uses: actions/checkout@v2
@@ -19,10 +16,18 @@ jobs:
1916
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
2017

2118
- name: Yarn cache
22-
uses: c-hive/gha-yarn-cache@v2
19+
uses: actions/setup-node@v3
20+
with:
21+
cache: 'yarn'
22+
23+
- name: Install dependencies
24+
run: "yarn install"
25+
26+
- name: Build
27+
run: "yarn build"
2328

2429
- name: Run tests with coverage
25-
run: "yarn install && yarn build && yarn coverage"
30+
run: "yarn coverage"
2631

2732
- name: Upload coverage
2833
uses: codecov/codecov-action@v2

0 commit comments

Comments
 (0)