Refactor install.sh to remove unnecessary code and improve installati… #32
This file contains 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: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
platform: [intel, arm] | |
steps: | |
# Checkout the code | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# Cache Node.js dependencies | |
- name: Cache Node.js modules | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
# Set up Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
# Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Matrix conditional setup for different OS/Platforms | |
- name: Setup Platform Details | |
run: | | |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
if [[ "${{ matrix.platform }}" == "arm" ]]; then | |
sudo apt-get update | |
sudo apt-get install -y build-essential libxml2-dev | |
fi | |
fi | |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
if [[ "${{ matrix.platform }}" == "arm" ]]; then | |
echo "Simulating Apple Silicon scenario" | |
else | |
echo "Simulating Intel Mac scenario" | |
fi | |
fi | |
# Run tests | |
- name: Run tests | |
run: npm run test |