update readme #223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nodevisor Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-os: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ['windows-2022', 'macos-13', 'ubuntu-20.04'] | |
| node-version: [20.x] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies and run tests | |
| run: | | |
| npm install; | |
| npm run build; | |
| npm test; | |
| test-distribution: | |
| if: contains(github.event.head_commit.message, 'test-distribution') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ['debian:bullseye', 'ubuntu:focal', 'fedora:39'] | |
| node-version: [18.x] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker container | |
| shell: bash | |
| run: | | |
| docker run -v ${{ github.workspace }}:/workspace \ | |
| -w /workspace \ | |
| ${{ matrix.os }} \ | |
| /bin/bash -c " | |
| # Update and install essential packages | |
| if [[ '${{ matrix.os }}' == debian:* ]] || [[ '${{ matrix.os }}' == ubuntu:* ]]; then | |
| apt-get update && apt-get install -y build-essential curl; | |
| elif [[ '${{ matrix.os }}' == centos:* ]]; then | |
| yum update -y && yum groupinstall -y 'Development Tools' && yum install -y curl; | |
| elif [[ '${{ matrix.os }}' == fedora:* ]]; then | |
| dnf update -y && dnf groupinstall -y 'Development Tools' && dnf install -y curl; | |
| fi; | |
| # Install Node.js | |
| if [[ '${{ matrix.os }}' == debian:* ]] || [[ '${{ matrix.os }}' == ubuntu:* ]]; then | |
| curl -fsSL https://deb.nodesource.com/setup_${{ matrix.node-version }} | bash -; | |
| apt-get install -y nodejs; | |
| elif [[ '${{ matrix.os }}' == centos:* ]]; then | |
| curl -fsSL https://rpm.nodesource.com/setup_${{ matrix.node-version }} | bash -; | |
| yum install -y nodejs; | |
| elif [[ '${{ matrix.os }}' == fedora:* ]]; then | |
| curl -fsSL https://rpm.nodesource.com/setup_${{ matrix.node-version }} | bash -; | |
| dnf install -y nodejs; | |
| fi; | |
| # Step 3: Install project dependencies | |
| npm install; | |
| # Step 4: Build the project | |
| npm run build; | |
| # Step 5: Run tests | |
| SAFE=true npm test; | |
| " |