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:
|
2022-04-25 07:36:50 +08:00
|
|
|
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
|
2021-09-14 14:51:51 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
2022-02-02 10:28:44 +08:00
|
|
|
- windows-2022
|
2021-09-14 14:51:51 +08:00
|
|
|
- windows-2019
|
|
|
|
- ubuntu-20.04
|
2022-02-14 11:41:23 +08:00
|
|
|
- ubuntu-18.04
|
|
|
|
- macos-11
|
2021-09-14 14:51:51 +08:00
|
|
|
- macos-10.15
|
|
|
|
node:
|
|
|
|
- 14 # installed on the images
|
|
|
|
pnpm:
|
2022-05-26 06:50:41 +08:00
|
|
|
- 7
|
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-15 14:29:57 +08:00
|
|
|
# Create self-contained executable that bundles Nodejs
|
|
|
|
- name: Create Executable
|
2022-02-14 11:41:23 +08:00
|
|
|
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
|
2021-09-15 14:29:57 +08:00
|
|
|
run: |
|
|
|
|
pnpm run pack.exe
|
|
|
|
|
|
|
|
- name: Upload Executable
|
2022-02-14 11:41:23 +08:00
|
|
|
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
|
2021-09-15 14:29:57 +08:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./exe
|
|
|
|
./dist
|
|
|
|
retention-days: 1
|
2021-09-18 20:12:22 +08:00
|
|
|
|
2022-01-31 11:01:34 +08:00
|
|
|
# - name: Setup SSH debugging session
|
|
|
|
# uses: mxschmitt/action-tmate@v3
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
|
|
|
|
run: |
|
|
|
|
pnpm run test
|
2022-02-14 12:16:18 +08:00
|
|
|
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
|
2022-01-31 11:01:34 +08:00
|
|
|
|
2021-09-18 20:12:22 +08:00
|
|
|
Docker:
|
2022-04-25 07:36:50 +08:00
|
|
|
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip docker]') }}
|
2021-09-18 20:12:22 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-20.04
|
2022-02-15 17:23:01 +08:00
|
|
|
container:
|
|
|
|
- "ubuntu_node.dockerfile"
|
2022-05-03 13:37:10 +08:00
|
|
|
- "ubuntu_20.04_node.dockerfile"
|
2021-09-18 20:12:22 +08:00
|
|
|
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: |
|
2022-04-27 13:07:54 +08:00
|
|
|
docker build -f ./dev/docker/${{ matrix.container }} -t setup_cpp .
|
2021-09-18 20:20:18 +08:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|