Skip to content

Commit

Permalink
ci: enhance our test environment setup (less#4291)
Browse files Browse the repository at this point in the history
* fix: pptr timeout issue

* fix: try again

* chore: fix pptr timeout issue

* fix: test scripts

* chore: drop node 10/12/14

* fix: node 23 deprecated api

* chore: tru again

* fix: windows

* fix: windows is

* chore: test node14

* fix: drop node v10/v12/v14 support

* chore: remove sandbox config

* fix: add sandbox config

* ci: try playwright

* chore: update ci yml

* chore: test node

* chore: add all test

* fix: yml grammer

* chore: try topo

* chore: node23 test

* chore: nodejs v23

* fix: yml grammer

* fix: steps's id

* chore: final test config

* chore: update folder name

* chore: refactor

* chore: update title

* chore: improve code quality

fix: node23 ci (less#4309)

* fix: node23 ci

* Update package-lock.json

* chore: rename node23 ci

* chore: rename
  • Loading branch information
iChenLei authored and puckowski committed Jan 17, 2025
1 parent 9d92b0c commit d91a651
Show file tree
Hide file tree
Showing 9 changed files with 1,427 additions and 1,087 deletions.
95 changes: 87 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Github actions workflow name
name: Nodejs Test
name: CI

# Triggers the workflow on push or pull request events
on:
Expand All @@ -9,13 +9,31 @@ on:
branches: [main, master]

jobs:
platform_spec_test:
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
basic_node_test:
name: 'Basic tests on ubuntu-latest with nodejs v22 (current LTS version)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

windows_and_macos_test:
name: 'Platform tests on ${{matrix.os}} with nodejs v${{matrix.node}}'
needs: basic_node_test
strategy:
matrix:
# Test all mainstream operating system
os: [ubuntu-latest, macos-latest, windows-latest]
node: [18]
os: [macos-latest, windows-latest]
node: [22]
runs-on: ${{ matrix.os }}
steps:
# Pull repo to test machine
Expand All @@ -30,15 +48,18 @@ jobs:
- name: Print put node & npm version
# Output useful info for debugging.
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

fast_node_test:
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
historical_versions_node_test:
name: 'Historical version nodejs v${{matrix.node}} test'
needs: basic_node_test
strategy:
matrix:
os: [ubuntu-latest]
node: [10, 12, 14, 16, 20]
node: [14, 16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -49,5 +70,63 @@ jobs:
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

latest_nodejs_testing_node23:
name: 'Latest nodejs v23 test'
needs: basic_node_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 23
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

update-changelog:
if: ${{ github.event_name == 'push' && contains(join(github.event.commits.*.message, ' '), 'Release v') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
# Ensure we can push back to the repo
persist-credentials: true
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install Dependencies
run: npm ci

- name: Generate Changelog
run: npm run changelog

- name: Commit and Push Changelog
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Check if there are any changes to commit
if [ -n "$(git status --porcelain)" ]; then
git add CHANGELOG.md
git commit -m "chore(release): update CHANGELOG [ci]"
git push origin HEAD:master
else
echo "No changes to commit."
fi
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
## [4.2.1](https://github.com/less/less.js/compare/4.1.3-container-queries-1...4.2.1) (2025-01-14)


### Bug Fixes

* fix CI ([ae453bd](https://github.com/less/less.js/commit/ae453bd58f006dc3b37adf35519d83e509483b7e))
* fix CI v2 ([e5c63b9](https://github.com/less/less.js/commit/e5c63b90c8bf8e51294643b75ef5a2a377f06e9e))
* fix CI v3 ([8e7a214](https://github.com/less/less.js/commit/8e7a214fd91c358952b0c826fd48878f4ea09893))
* fix CI v4 ([924c2a2](https://github.com/less/less.js/commit/924c2a27551dfb316a733387903104dbdf61e658))
* node23 ci ([#4309](https://github.com/less/less.js/issues/4309)) ([ab5c82f](https://github.com/less/less.js/commit/ab5c82f86f1e04c6eac9d4e1a29526893248b720))
* Output correct css when using css function in max(). ([#4266](https://github.com/less/less.js/issues/4266)) ([b09ad0f](https://github.com/less/less.js/commit/b09ad0f62a502a326de7065a62fd69e29837bcc1))


### Features

* **meta 46:** update CI to update CHANGELOG ([2b010da](https://github.com/less/less.js/commit/2b010da80bde46aed34e11dce47125e7c1b8beb7))



## [4.2.1](https://github.com/less/less.js/compare/4.1.3-container-queries-1...4.2.1) (2025-01-14)


### Bug Fixes

* fix CI ([ae453bd](https://github.com/less/less.js/commit/ae453bd58f006dc3b37adf35519d83e509483b7e))
* fix CI v2 ([e5c63b9](https://github.com/less/less.js/commit/e5c63b90c8bf8e51294643b75ef5a2a377f06e9e))
* fix CI v3 ([8e7a214](https://github.com/less/less.js/commit/8e7a214fd91c358952b0c826fd48878f4ea09893))
* node23 ci ([#4309](https://github.com/less/less.js/issues/4309)) ([ab5c82f](https://github.com/less/less.js/commit/ab5c82f86f1e04c6eac9d4e1a29526893248b720))
* Output correct css when using css function in max(). ([#4266](https://github.com/less/less.js/issues/4266)) ([b09ad0f](https://github.com/less/less.js/commit/b09ad0f62a502a326de7065a62fd69e29837bcc1))


### Features

* **meta 46:** update CI to update CHANGELOG ([2b010da](https://github.com/less/less.js/commit/2b010da80bde46aed34e11dce47125e7c1b8beb7))



## [4.2.1](https://github.com/less/less.js/compare/4.1.3-container-queries-1...4.2.1) (2025-01-14)


### Bug Fixes

* fix CI ([ae453bd](https://github.com/less/less.js/commit/ae453bd58f006dc3b37adf35519d83e509483b7e))
* node23 ci ([#4309](https://github.com/less/less.js/issues/4309)) ([ab5c82f](https://github.com/less/less.js/commit/ab5c82f86f1e04c6eac9d4e1a29526893248b720))
* Output correct css when using css function in max(). ([#4266](https://github.com/less/less.js/issues/4266)) ([b09ad0f](https://github.com/less/less.js/commit/b09ad0f62a502a326de7065a62fd69e29837bcc1))


### Features

* **meta 46:** update CI to update CHANGELOG ([2b010da](https://github.com/less/less.js/commit/2b010da80bde46aed34e11dce47125e7c1b8beb7))



## [4.2.1](https://github.com/less/less.js/compare/4.1.3-container-queries-1...4.2.1) (2025-01-14)


### Bug Fixes

* node23 ci ([#4309](https://github.com/less/less.js/issues/4309)) ([ab5c82f](https://github.com/less/less.js/commit/ab5c82f86f1e04c6eac9d4e1a29526893248b720))
* Output correct css when using css function in max(). ([#4266](https://github.com/less/less.js/issues/4266)) ([b09ad0f](https://github.com/less/less.js/commit/b09ad0f62a502a326de7065a62fd69e29837bcc1))


### Features

* **meta 46:** update CI to update CHANGELOG ([2b010da](https://github.com/less/less.js/commit/2b010da80bde46aed34e11dce47125e7c1b8beb7))



## Change Log

### v4.2.1 (2024-09-26)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<p align="center"><img src="http://lesscss.org/public/img/less_logo.png" width="264" height="117">

Test.

<p align="center">
<a href="https://github.com/less/less.js/actions?query=branch%3Amaster"><img src="https://github.com/less/less.js/actions/workflows/ci.yml/badge.svg?branch=master" alt="Github Actions CI"/></a>
<a href="https://www.npmtrends.com/less"><img src="https://img.shields.io/npm/dm/less.svg?sanitize=true" alt="Downloads"></a>
Expand Down
Loading

0 comments on commit d91a651

Please sign in to comment.