Skip to content

Commit

Permalink
adding GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Nov 12, 2024
1 parent 8196d17 commit 8d29200
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 3 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Test

on:
push:
paths-ignore:
- '.github/FUNDING.YML'
- '**/*.md'
- '**/*.d.ts'
- '.gitconfig'
- '.gitignore'
- '.npmignore'
- 'LICENSE*'
- '.idea/**'
- '.vscode/**'
- '.circleci'
- '.circleci/*'
- 'README.md'

jobs:
test:
runs-on: ${{ matrix.os }}
name: test-${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-2022]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ matrix.os }}${{ hashFiles('package-lock.json') }}

- name: npm install
run: npm i

- name: "Run tests"
run: npm test

# - name: Upload artifacts
# uses: actions/[email protected]
# if: success()
# with:
# name: ${{ matrix.os }}-${{ matrix.node }}
# path: |
# test-results.xml
# mochawesome.json
#
# - name: Test Report
# uses: phoenix-actions/test-reporting@v15
# if: success()
# with:
# name: test-results-${{ matrix.os }}-node-${{ matrix.node }}
# fail-on-error: true
# path: mochawesome.json # Path to test results
# reporter: mochawesome-json

6 changes: 3 additions & 3 deletions tests/converter.junit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ describe("JUnit converter tests", () => {
}

test('convert junit-jenkins.xml', async() => {
let options = createOptions('junit-jenkins.xml', 'junit')
let options = createOptions('junit-jenkins.xml', 'junit');

await margeConvert(options);
compare(options);
});

test('convert junit-notestsuites.xml', async() => {
let options = createOptions('junit-notestsuites.xml', 'junit')
let options = createOptions('junit-notestsuites.xml', 'junit');

await margeConvert(options);
compare(options, 'junit-jenkins-mochawesome.json');
});

test('convert junit-testsuites-noattributes.xml', async() => {
let options = createOptions('junit-testsuites-noattributes.xml', 'junit')
let options = createOptions('junit-testsuites-noattributes.xml', 'junit');

await margeConvert(options);
compare(options, 'junit-jenkins-mochawesome.json');
Expand Down

0 comments on commit 8d29200

Please sign in to comment.