ci: fix placing the built artifacts

This commit is contained in:
Amin Yahyaabadi 2023-07-24 14:08:07 -07:00
parent 697fc17c87
commit 4e58b250d7
3 changed files with 40 additions and 22 deletions

View File

@ -48,9 +48,13 @@ jobs:
with: with:
version: ${{ matrix.pnpm }} version: ${{ matrix.pnpm }}
- name: Install and build - name: Install
run: | run: |
pnpm install pnpm install
- name: Build
run: |
pnpm build
pnpm build.docker_tests pnpm build.docker_tests
- name: Upload Dist - name: Upload Dist
@ -62,8 +66,8 @@ jobs:
./dev/docker/__tests__/ ./dev/docker/__tests__/
retention-days: 1 retention-days: 1
Build_Executable: BuildExecutable:
name: Build_Executable-${{ matrix.os }} name: Build-Executable-${{ matrix.os }}
needs: [Build] needs: [Build]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -85,10 +89,6 @@ jobs:
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: dist name: dist
- name: Place Artifacts
shell: bash
run: |
mv -v artifact/* ./
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@ -100,6 +100,21 @@ jobs:
with: with:
version: ${{ matrix.pnpm }} 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 # Create self-contained executable that bundles Nodejs
- name: Create Executable - name: Create Executable
run: | run: |
@ -114,7 +129,7 @@ jobs:
retention-days: 1 retention-days: 1
Test: Test:
name: ${{ matrix.os }} name: Test-${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') || !contains(github.event.head_commit.message, '[skip test]') }} if: ${{ !contains(github.event.head_commit.message, '[skip ci]') || !contains(github.event.head_commit.message, '[skip test]') }}
needs: [Build] needs: [Build]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -141,10 +156,6 @@ jobs:
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: dist name: dist
- name: Place Dist
shell: bash
run: |
mv -v artifact/* ./
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@ -156,13 +167,24 @@ jobs:
with: with:
version: ${{ matrix.pnpm }} version: ${{ matrix.pnpm }}
# - name: Setup SSH debugging session - name: Cache node_modules
# uses: mxschmitt/action-tmate@v3 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 - name: Install
run: | run: |
pnpm install pnpm install
# - name: Setup SSH debugging session
# uses: mxschmitt/action-tmate@v3
- name: Test - name: Test
run: | run: |
pnpm run test pnpm run test
@ -184,7 +206,7 @@ jobs:
node ./dist/actions/setup-cpp.js --help node ./dist/actions/setup-cpp.js --help
Docker: Docker:
name: ${{ matrix.container }} name: Test-${{ matrix.container }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }} if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
needs: [Build] needs: [Build]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -213,10 +235,6 @@ jobs:
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: dist name: dist
- name: Place Dist
shell: bash
run: |
mv -v artifact/* ./
- name: Build - name: Build
id: docker_build id: docker_build
@ -226,7 +244,7 @@ jobs:
Release: Release:
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
needs: [Build, Build_Executable, Test, Docker] needs: [Build, BuildExecutable, Test, Docker]
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Download All Artifacts - name: Download All Artifacts

View File

@ -3,7 +3,7 @@ import type { Config } from "jest"
const jestConfig: Config = { const jestConfig: Config = {
testMatch: ["**/*.test.ts"], testMatch: ["**/*.test.ts"],
testEnvironment: "node", testEnvironment: "node",
extensionsToTreatAsEsm: [".ts", ".tsx", ".js", ".jsx"], extensionsToTreatAsEsm: [".ts", ".tsx", ".jsx"],
transformIgnorePatterns: [], // transform node_modules transformIgnorePatterns: [], // transform node_modules
transform: { transform: {
"^.+\\.(t|j)sx?$": "@swc/jest", "^.+\\.(t|j)sx?$": "@swc/jest",

View File

@ -56,7 +56,7 @@
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/", "test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
"test.lint.prettier": "prettier . --check", "test.lint.prettier": "prettier . --check",
"test.unit": "jest --runInBand", "test.unit": "jest --runInBand",
"build.docker_tests": "pnpm build && node ./dev/docker/__tests__/generate-docker-tests.mjs", "build.docker_tests": "node ./dev/docker/__tests__/generate-docker-tests.mjs",
"build.docker.arch": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/arch.dockerfile -t setup-cpp:arch .", "build.docker.arch": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/arch.dockerfile -t setup-cpp:arch .",
"build.docker.fedora": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/fedora.dockerfile -t setup-cpp:fedora .", "build.docker.fedora": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/fedora.dockerfile -t setup-cpp:fedora .",
"build.docker.ubuntu": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/ubuntu.dockerfile -t setup-cpp:ubuntu .", "build.docker.ubuntu": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/ubuntu.dockerfile -t setup-cpp:ubuntu .",