Skip to content

Commit

Permalink
Merge pull request #107 from trustpilot/improve-ci
Browse files Browse the repository at this point in the history
Improve ci
  • Loading branch information
tpfrne authored May 13, 2024
2 parents 8547624 + d32114c commit 0bb5109
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 9 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build-and-test-prs

'on':
pull_request:
types:
- opened
- synchronize

permissions:
contents: read

jobs:
made-with-tpgha:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setting up NodeJs
id: setup-node-js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: npm ci
run: npm ci --ignore-scripts
shell: bash

- name: npm run lint
run: npm run lint
shell: bash

- name: npm run test
run: npm run test
shell: bash

- name: npm run build
run: npm run build
shell: bash
14 changes: 5 additions & 9 deletions .github/workflows/pushes.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: build-and-release

"on":
'on':
push:
branches:
- master
pull_request:
types:
- opened
- synchronize

permissions:
contents: write
Expand All @@ -23,21 +19,21 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setting up NodeJs
id: setup-node-js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: npm ci
run: npm ci
shell: bash

- name: npm run lint
run: npm run lint
shell: bash

- name: npm run test
run: npm run test
shell: bash
Expand All @@ -51,4 +47,4 @@ jobs:
shell: bash
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0bb5109

Please sign in to comment.