Skip to content

Commit

Permalink
Merge pull request #208 from joshmarinacci/add-test-action
Browse files Browse the repository at this point in the history
Add test action
  • Loading branch information
joshmarinacci authored Oct 11, 2024
2 parents c5141c4 + 48b8743 commit 18fd80e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/github-actions-demo.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Unit Tests

on:
schedule:
- cron: 0 */6 * * *
pull_request:
branches: [main]
push:
branches: ["*"]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: install deps
run: npm ci

- name: run tests
run: npm run vitest

- name: hello
run: echo 'hello'

- name: upload tests
run: |
curl -fsSL --retry 3 "https://github.com/trunk-io/analytics-cli/releases/latest/download/trunk-analytics-cli-x86_64-unknown-linux.tar.gz" | tar -xvz > ./trunk-analytics-cli
./trunk-analytics-cli upload --junit-paths "test-output.xml" --org-url-slug ${{secrets.TRUNK_ORG_SLUG}} --token ${{secrets.TRUNK_API_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"scripts": {
"test": "npm run vitest && npm run type-check",
"vitest": "vitest run --dir test",
"vitest": "vitest run --dir test --reporter=junit --outputFile=test-output.xml",
"build": "node build.js",
"type-check": "tsc",
"clean": "rm -rf dist/ output/ *.tgz",
Expand Down

0 comments on commit 18fd80e

Please sign in to comment.