Skip to content

feat: add timeout for installation of the tools + feat: fail fast inside CI when an error happens #855

feat: add timeout for installation of the tools + feat: fail fast inside CI when an error happens

feat: add timeout for installation of the tools + feat: fail fast inside CI when an error happens #855

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
- main
- dev
tags:
- "*"
jobs:
Build:
runs-on: ubuntu-22.04
name: Build
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
node:
- 20
pnpm:
- 8
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
D:\.pnpm-store
./node_modules
./.parcel-cache
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
restore-keys: |
"setupcpp-cache-OS:${{ matrix.os }}-"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm }}
- name: Install
run: |
pnpm install
- name: Build
run: |
pnpm build
pnpm build.docker_tests
- name: Lint
run: |
pnpm run test.lint
- name: Upload Dist
uses: actions/upload-artifact@v3
with:
name: dist
path: |
./dist
./packages/*/dist
./dev/docker/__tests__/
retention-days: 1
BuildExecutable:
name: Build-Executable-${{ matrix.os }}
needs: [Build]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
- ubuntu-22.04
- macos-12
node:
- 20
pnpm:
- 8
steps:
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: dist
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm }}
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
D:\.pnpm-store
./node_modules
key: "setupcpp-node_modules-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
restore-keys: |
"setupcpp-node_modules-cache-OS:${{ matrix.os }}-"
- name: Install
run: |
pnpm install
# Create self-contained executable that bundles Nodejs
- name: Create Executable
run: |
pnpm run pack.exe
- name: Upload Executables
uses: actions/upload-artifact@v3
with:
name: exe
path: |
./exe
retention-days: 1
Test:
name: Test-${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') || !contains(github.event.head_commit.message, '[skip test]') }}
needs: [Build]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
- windows-2019
- ubuntu-22.04
- ubuntu-20.04
- macos-12
- macos-11
node:
- 20
pnpm:
- 8
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download Dist
uses: actions/download-artifact@v3
with:
name: dist
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm }}
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
D:\.pnpm-store
./node_modules
key: "setupcpp-node_modules-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
restore-keys: |
"setupcpp-node_modules-cache-OS:${{ matrix.os }}-"
- name: Install
run: |
pnpm install
# - name: Setup SSH debugging session
# uses: mxschmitt/action-tmate@v3
- name: Tests
run: |
pnpm run test
- name: Setup Node 12
uses: actions/setup-node@v3
with:
node-version: 12
- name: Smoke Test Node 12
run: |
node ./dist/legacy/setup-cpp.js --help
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Smoke Test Node 16
run: |
node ./dist/actions/setup-cpp.js --help
Docker:
name: Test-${{ matrix.container }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
needs: [Build]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
node:
- 20
pnpm:
- 8
container:
- "ubuntu.dockerfile"
- "fedora.dockerfile"
- "arch.dockerfile"
- "ubuntu-mingw.dockerfile"
# - "fedora-mingw.dockerfile"
# - "arch-mingw.dockerfile"
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download Dist
uses: actions/download-artifact@v3
with:
name: dist
- name: Build
id: docker_build
run: |
docker build -f ./dev/docker/__tests__/${{ matrix.container }} -t setup-cpp .
Release:
if: startsWith(github.ref, 'refs/tags/')
needs: [Build, BuildExecutable, Test, Docker]
runs-on: ubuntu-22.04
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v3
- name: Place Artifacts
shell: bash
run: |
mv -v ./dist/* ./
mv -v ./exe/* ./
chmod +x -R ./exe/
- name: Draft the release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
gzip: folders
draft: true
files: >
./exe/setup-cpp-x64-windows.exe
./exe/setup-cpp-x64-linux
./exe/setup-cpp-x64-macos
./dist/legacy/setup-cpp.js
./dist/legacy/setup-cpp.js.map
./dist/legacy/
./dist/actions/
./dist/modern/