2021-09-14 14:51:51 +08:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- main
|
2021-09-18 20:12:22 +08:00
|
|
|
- dev
|
2021-09-14 14:51:51 +08:00
|
|
|
|
|
|
|
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
|
2021-09-15 14:29:57 +08:00
|
|
|
cache_reset_counter:
|
|
|
|
- 0
|
2021-09-14 14:51:51 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-15 04:23:45 +08:00
|
|
|
with:
|
|
|
|
submodules: true
|
2021-09-14 14:51:51 +08:00
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
|
|
|
D:\.pnpm-store
|
2021-09-15 14:29:57 +08:00
|
|
|
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}-${{ matrix.cache_reset_counter }}"
|
2021-09-14 14:51:51 +08:00
|
|
|
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
|
|
|
|
|
2021-09-14 15:49:18 +08:00
|
|
|
- name: Test
|
|
|
|
run: |
|
2021-09-15 14:29:57 +08:00
|
|
|
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
|
2021-09-18 20:12:22 +08:00
|
|
|
|
|
|
|
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
|
2021-09-18 20:20:18 +08:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|