diff --git a/.github/workflows/browser.yml b/.github/workflows/browser.yml index 644bd5d0..efd0d908 100644 --- a/.github/workflows/browser.yml +++ b/.github/workflows/browser.yml @@ -1,4 +1,3 @@ - name: Browser Tests on: @@ -6,27 +5,32 @@ on: branches: [ "*" ] pull_request: branches: [ "*" ] - workflow_dispatch: - branches: [ "*" ] + workflow_dispatch: {} jobs: build: - - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - + # Checkout the repository - uses: actions/checkout@v3 - - - name: Setup Node.js 18.x + + # Setup Node.js environment (use 18.x and enable caching) + - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 18.x - cache: npm + node-version: 20.x + cache: 'npm' - - run: npm ci --legacy-peer-deps + # Install dependencies + - name: Install dependencies + run: npm ci --legacy-peer-deps - - run: npm run build --if-present + # Build the project (if there is a build script) + - name: Build the project + run: npm run build --if-present - - run: npm run nightwatch + # Run Nightwatch tests + - name: Run Nightwatch tests + run: npm run test:e2e diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ef328a0c..2f16074a 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -1,4 +1,3 @@ - name: NodeJS Tests on: @@ -6,36 +5,41 @@ on: branches: [ "*" ] pull_request: branches: [ "*" ] - workflow_dispatch: - branches: [ "*" ] + workflow_dispatch: {} jobs: build: - - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: node-version: [ 18.x, 20.x ] steps: - + # Checkout the repository - uses: actions/checkout@v3 - + + # Setup Node.js environment (use matrix for different versions) - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: npm + cache: 'npm' - - run: npm ci --legacy-peer-deps + # Install dependencies + - name: Install dependencies + run: npm ci --legacy-peer-deps - - run: npm run build --if-present + # Build the project (if a build script exists) + - name: Build the project + run: npm run build --if-present - - run: npm test + # Run tests + - name: Run tests + run: npm run cover:unit + # Upload coverage to Coveralls - name: Coveralls - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - diff --git a/package.json b/package.json index b9600848..17b7d024 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,7 @@ "cover": "npm run cover:unit && npm run cover:e2e && npm run cover:report", "cover:integration": "nyc --silent --no-clean npm run test:integration", "cover:report": "nyc report --reporter=lcov --reporter=text", - "dev": "nodemon -w src -w test -w rollup.config.mjs -e ts,js -x 'npm run clean && npm run build && npm run cover'", - "nightwatch": "npm run test:e2e" + "dev": "nodemon -w src -w test -w rollup.config.mjs -e ts,js -x 'npm run clean && npm run build && npm run cover'" }, "devDependencies": { "@rollup/plugin-node-resolve": "^15.2.3",