setup-cpp/.github/workflows/CI.yml

122 lines
2.8 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- master
- main
- dev
jobs:
Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- ubuntu-20.04
- macos-10.15
node:
- 14 # installed on the images
pnpm:
- 6
cache_reset_counter:
- 0
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.pnpm-store
D:\.pnpm-store
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}-${{ matrix.cache_reset_counter }}"
restore-keys: |
"setupcpp-cache-OS:${{ matrix.os }}"
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm }}
- name: Install and build
run: |
pnpm install
# - name: Setup SSH debugging session
# uses: mxschmitt/action-tmate@v3
- name: Test
run: |
pnpm run test
# Create self-contained executable that bundles Nodejs
- name: Create Executable
run: |
pnpm run pack.exe
- name: Upload Executable
uses: actions/upload-artifact@v2
with:
path: |
./exe
./dist
retention-days: 1
Docker:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
node:
- 14
pnpm:
- 6
cache_reset_counter:
- 0
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.pnpm-store
D:\.pnpm-store
key: "setupcpp-docker-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}-${{ matrix.cache_reset_counter }}"
restore-keys: |
"setupcpp-docker-cache-OS:${{ matrix.os }}"
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm }}
- name: Install and build
run: |
pnpm install
- name: Build
id: docker_build
run: |
pnpm build.docker
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true