Skip to content

Commit

Permalink
Merge pull request #21 from siddharthkp/siddharthkp-patch-1
Browse files Browse the repository at this point in the history
Add github action to run tests
  • Loading branch information
siddharthkp committed Nov 21, 2023
2 parents a16ee73 + c418985 commit 557dc66
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
cache: 'npm'
- run: npm ci
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} SHA=${{github.sha}} npm test
5 changes: 2 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ const Build = require('./index')

const data = {
repo: 'siddharthkp/github-build',
sha: process.env.TRAVIS_PULL_REQUEST_SHA ||
'4391039e9c506a1702ee7971cda4613ca5da2d69',
token: process.env.github_token,
sha: process.env.SHA || process.env.TRAVIS_PULL_REQUEST_SHA || '4391039e9c506a1702ee7971cda4613ca5da2d69',
token: process.env.GITHUB_TOKEN,
label: 'github-build',
description: 'Running some tests'
}
Expand Down

0 comments on commit 557dc66

Please sign in to comment.