Skip to content

Commit

Permalink
feat(workflow): define integration workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rochejul committed Aug 18, 2024
1 parent d6c40f7 commit b501c7e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js Integration Test

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

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:integration
1 change: 0 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<a href="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/node.js.yml">
<img src="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/node.js.yml/badge.svg" alt="Node.js Unit Test">
</a>

<a href="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/integration.yml">
<img src="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/integration.yml/badge.svg" alt="Node.js Integration Test">
</a>
</p>

# web-component-attribute-polyfill
Expand Down Expand Up @@ -177,6 +181,7 @@ And at the end, use it on your elements:
- `npm run start:ts`: Run the typescript demo
- `npm test`: Run tests over packages
- `npm run test:coverage`: Run tests over packages and see coverage reports
- `npm run test:integration`: Run integration tests
## Contributing
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"start": "npm run start --workspace demos/vanilla",
"start:ts": "npm run start --workspace demos/typescript",
"test": "npm run test --workspaces --if-present",
"test:coverage": "npm run test:coverage --workspaces --if-present"
"test:coverage": "npm run test:coverage --workspaces --if-present",
"test:integration": "npm run test:headless --workspace ./packages/test-integration"
},
"//": {
"dev:audit": "Checks we don't have vulnearbilities",
Expand All @@ -33,7 +34,8 @@
"start": "Run the vanilla demo",
"start:ts": "Run the typescript demo",
"test": "Run tests over packages",
"test:coverage": "Run tests over packages and see coverage reports"
"test:coverage": "Run tests over packages and see coverage reports",
"test:integration": "Run integration tests"
},
"workspaces": [
"packages/*",
Expand Down
6 changes: 3 additions & 3 deletions packages/test-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<img src="https://snyk.io/test/github/rochejul/web-component-attribute-polyfill/badge.svg?targetFile=packages/test-integration/package.json" alt="Known Vulnerabilities">
</a>

<a href="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/node.js.yml">
<img src="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/node.js.yml/badge.svg" alt="Node.js Unit Test">
<a href="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/integration.yml">
<img src="https://github.com/rochejul/web-component-attribute-polyfill/actions/workflows/integration.yml/badge.svg" alt="Node.js Integration Test">
</a>
</p>

Expand All @@ -25,7 +25,7 @@ Integration testing of the polyfill
- `npm run dev:linting`: Lint files
- `npm start`: Run a local web server (with https) to show the project
- `npm run test:browser`: Run tests without headless mode
- `npm run test:hedaless`: Run tests with headless mode
- `npm run test:headless`: Run tests with headless mode

## Contributing

Expand Down

0 comments on commit b501c7e

Please sign in to comment.