Merge pull request #52 from mussonindustrial/changeset-release/main #168
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Build | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Restore Ignition Image Cache if it exists | |
id: cache-docker-ignition | |
uses: actions/cache@v3 | |
with: | |
path: ci/cache/docker/ignition | |
key: cache-docker-ignition | |
- name: Update Ignition Image Cache if cache miss | |
if: steps.cache-docker-ignition.outputs.cache-hit != 'true' | |
run: docker pull inductiveautomation/ignition:8.1.33 && mkdir -p ci/cache/docker/ignition && docker image save inductiveautomation/ignition:8.1.33 --output ./ci/cache/docker/ignition/ignition-8.1.33.tar | |
- name: Use Ignition Image Cache if cache hit | |
if: steps.cache-docker-ignition.outputs.cache-hit == 'true' | |
run: docker image load --input ./ci/cache/docker/ignition/ignition-8.1.33.tar | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build --if-present | |
- run: npm test |