diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml index 88c9f67..e8e2701 100644 --- a/.github/workflows/react.yml +++ b/.github/workflows/react.yml @@ -5,24 +5,25 @@ name: Ensure React Project Builds on: push: - branches: [ "dev", "main" ] + branches: ["dev", "main"] pull_request: - branches: [ "dev", "main" ] - + branches: ["dev", "main"] env: - WORKING_DIRECTORY: ./src/EducationTrail/ClientApp - + WORKING_DIRECTORY: ./src/EducationTrail/ClientApp jobs: build: - runs-on: ubuntu-latest - + strategy: + matrix: + # omits 14.x because some of our devDependencies require 16.x or higher + node-version: [18.x, 20.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '18.x' - cache: 'npm' - - run: npm ci --prefix "${{ env.WORKING_DIRECTORY }}" - - run: npm run build + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci --prefix "${{ env.WORKING_DIRECTORY }}" + - run: npm run build --prefix "${{ env.WORKING_DIRECTORY }}" \ No newline at end of file