Skip to content

Commit 74d7714

Browse files
authored
Create ci.yml (#48)
1 parent c5669ea commit 74d7714

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
security_hardening:
10+
name: Check security hardening
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Clone the repository
14+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
15+
- name: Ensure SHA pinned actions
16+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@af2eb3226618e2494e3d9084f515ad6dcf16e229
17+
18+
build_test:
19+
name: Build & Test
20+
needs: security_hardening
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Clone the repository
24+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
25+
with:
26+
ref: ${{ github.head_ref }} # https://github.com/stefanzweifel/git-auto-commit-action#checkout-the-correct-branch
27+
- name: Get runs.using version
28+
id: get-runs-using-version
29+
uses: zgosalvez/github-actions-get-action-runs-using-version@a15b651c3198e1547715f3428b328e7ef89ab8d8
30+
- name: Set up Node
31+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
32+
with:
33+
node-version: v${{ steps.get-runs-using-version.outputs.version }}
34+
- name: Cache Node Packages
35+
id: node-cache
36+
uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d
37+
with:
38+
path: ~/.npm
39+
key: node-cache-${{ steps.get-runs-using-version.outputs.prop }}-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
node-cache-${{ steps.get-runs-using-version.outputs.prop }}-
42+
node-cache-
43+
- name: Get Node packages
44+
run: npm ci
45+
- name: Run linter tool
46+
run: npm run lint
47+
- name: Prepare
48+
run: npm run prepare
49+
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a
50+
with:
51+
commit_message: Apply `npm run prepare` changes

0 commit comments

Comments
 (0)