iterate on publish.yml #257
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 is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
prepare: | |
strategy: | |
matrix: | |
node-version: [20.x] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm install | |
- name: Cache dependencies | |
uses: actions/cache@v4.1.1 | |
with: | |
key: ${{ runner.os }}-node-modules-${{ github.sha }} | |
path: node_modules | |
build: | |
needs: prepare | |
strategy: | |
matrix: | |
node-version: [20.x] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache dependencies | |
uses: actions/cache@v4.1.1 | |
with: | |
key: ${{ runner.os }}-node-modules-${{ github.sha }} | |
path: node_modules | |
- run: npm install | |
- run: npm run build | |
- name: Cache build artifacts | |
uses: actions/cache@v4.1.1 | |
with: | |
enableCrossOsArchive: true | |
key: dist-${{ github.sha }} | |
path: | | |
./packages/node-opcua-crypto/dist* | |
./packages/node-opcua-crypto-test/dist* | |
test-new: | |
needs: build | |
strategy: | |
matrix: | |
node-version: [19.x, 20.x, 22.x] | |
os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: checkout | |
uses: actions/checkout@v4.2.2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore dependencies | |
uses: actions/cache@v4.1.1 | |
with: | |
key: ${{ runner.os }}-node-modules-${{ github.sha }} | |
path: node_modules | |
- name: Restore build artifacts | |
uses: actions/cache@v4.1.1 | |
with: | |
enableCrossOsArchive: true | |
key: dist-${{ github.sha }} | |
path: | | |
./packages/node-opcua-crypto/dist* | |
./packages/node-opcua-crypto-test/dist* | |
- name: Run test | |
run: npm test | |
test: | |
needs: build | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x] | |
os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4.2.2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: nodejs | |
run: node --version | |
- name: Restore dependencies | |
uses: actions/cache@v4.1.1 | |
with: | |
key: ${{ runner.os }}-node-modules-${{ github.sha }} | |
path: node_modules | |
- name: Restore build artifacts | |
uses: actions/cache@v4.1.1 | |
with: | |
enableCrossOsArchive: true | |
key: dist-${{ github.sha }} | |
path: | | |
./packages/node-opcua-crypto/dist* | |
./packages/node-opcua-crypto-test/dist* | |
- name: Run test | |
run: npm test | |
- name: run esm test | |
run: npm run esm:test | |
# test-legacy: | |
# needs: build | |
# strategy: | |
# matrix: | |
# node-version: [14.x] | |
# os: [ | |
# # ubuntu-18.04, | |
# ubuntu-20.04, | |
# ubuntu-latest, | |
# macos-latest, | |
# windows-latest, | |
# ] | |
# runs-on: ${{ matrix.os }} | |
# steps: | |
# - name: checkout | |
# uses: actions/checkout@v4.2.2 | |
# - name: Use Node.js ${{ matrix.node-version }} | |
# uses: actions/setup-node@v4.1.0 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# - name: nodejs | |
# run: node --version | |
# - name: Restore dependencies | |
# uses: actions/cache@v4.1.1 | |
# with: | |
# key: ${{ runner.os }}-node-modules-${{ github.sha }} | |
# path: node_modules | |
# - name: Restore build artifacts | |
# uses: actions/cache@v4.1.1 | |
# with: | |
# enableCrossOsArchive: true | |
# key: dist-${{ github.sha }} | |
# path: | | |
# ./packages/node-opcua-crypto/dist* | |
# ./packages/node-opcua-crypto-test/dist* | |
# - name: Run test | |
# run: npm test |