diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..ef7679d69 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +# Github actions workflow name +name: Nodejs Test + +# Triggers the workflow on push or pull request events +on: [push, pull_request] + +jobs: + test: + name: 'Tests on ${{matrix.os}} with node${{matrix.node}}' + strategy: + matrix: + # Test all mainstream operating system + os: [ubuntu-latest, macos-latest, windows-latest] + # Latest four Nodejs LTS version + node: [10, 12, 14, 16] + runs-on: ${{ matrix.os }} + steps: + # Pull repo to test machine + - uses: actions/checkout@v2 + # Configures the node version used on GitHub-hosted runners + - uses: actions/setup-node@v2 + with: + # The Node.js version to configure + node-version: ${{ matrix.node }} + + # Caching dependencies to speed up workflows + - name: Get npm cache directory + id: npm-cache-dir + run: | + echo "::set-output name=dir::$(npm config get cache)" + - uses: actions/cache@v2 + id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install npm dependencies + run: npm install + + - name: Print put node & npm version + # Output useful info for debugging. + run: node --version && npm --version + + - name: Run unit test + run: cd packages/less && npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 38639ae60..000000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - "14" - - "12" - - "10" - - "8" -install: - - npm install -g grunt-cli - - travis_retry npm install -env: - global: - - secure: TrNVruWYaUK5ALga1y7wRY+MLjWJECUSCsBmKW5EUmIevOUxqHWu7M89FANKxstEeFRRAGH3QJbloRxnzIgh0U0ah5npE9XA1bYXGO5khoXeIyk7pNRfjIo8aEnJH1Vp8vWA6J6ovxdJ7lCFKEGvGKxGde50knVl7KFVVULlX2U= - - secure: Rzh+CEI7YRvvVkOruPE8Z0dkU0s13V6b6cpqbN72vxbJl/Jm5PUZkjTFJdkWJrW3ErhCKX6EC7XdGvrclqEA9WAqKzrecqCJYqTnw4MwqiAj6F9wqE/BqhoWg4xPxm0MK/7eJMvLCgjNpe+gc1CaeFJZkLSNWn6nOFke+vVlf9Q= -sudo: false