-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathliboliphaunt-native-desktop.yml
More file actions
118 lines (107 loc) · 4.35 KB
/
Copy pathliboliphaunt-native-desktop.yml
File metadata and controls
118 lines (107 loc) · 4.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: liboliphaunt-native-desktop
on:
workflow_call:
inputs:
cache-save-if:
description: Resolved cache-save policy from the calling CI workflow.
required: true
type: boolean
matrix:
required: true
type: string
job-targets:
required: true
type: string
permissions:
contents: read
env:
OLIPHAUNT_CI_JOB_TARGETS_JSON: ${{ inputs.job-targets }}
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
defaults:
run:
shell: bash
jobs:
build:
name: Builds / Native Runtime (${{ matrix.target }})
strategy:
fail-fast: false
matrix: ${{ fromJson(inputs.matrix) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
env:
CCACHE_DIR: ${{ github.workspace }}/.ci-cache/ccache/native-runtime/${{ matrix.target }}
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: "true"
OLIPHAUNT_CCACHE_ZERO_STATS: "1"
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Set up Moon
uses: ./.github/actions/setup-moon
with:
cache-partition: native-${{ matrix.target }}
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache-save-if: ${{ inputs.cache-save-if }}
- name: Set up MSVC
if: ${{ runner.os == 'Windows' }}
uses: ./.github/actions/setup-msvc
- name: Prepare native build paths
env:
NATIVE_BUILD_ROOT: ${{ matrix.build-root }}
run: |
mkdir -p "$NATIVE_BUILD_ROOT"
if [[ "$RUNNER_OS" != "Windows" ]]; then
mkdir -p "$CCACHE_DIR"
fi
- name: Configure native compiler cache
run: .github/scripts/setup-native-build-tools.sh 2G
- name: Build and package liboliphaunt native runtime
env:
OLIPHAUNT_CI_TARGET: ${{ matrix.target }}
run: .github/scripts/run-planned-moon-job.sh liboliphaunt-native-desktop
- name: Upload liboliphaunt release assets
if: ${{ contains(fromJson(inputs.job-targets).liboliphaunt-native-desktop, 'liboliphaunt-native:package-runtime-desktop-target') }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: liboliphaunt-native-release-assets-${{ matrix.target }}
path: target/liboliphaunt/desktop-release-assets/${{ matrix.target }}
if-no-files-found: error
- name: Upload PostgreSQL tools release assets
if: ${{ contains(fromJson(inputs.job-targets).liboliphaunt-native-desktop, 'postgres-tools-native:package-assets') || contains(fromJson(inputs.job-targets).liboliphaunt-native-desktop, 'postgres-tools-native:test-assets') }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: postgres-tools-native-release-assets-${{ matrix.target }}
path: target/postgres-tools/native/release-assets
if-no-files-found: error
- name: Upload independent native cluster seeds
if: ${{ contains(fromJson(inputs.job-targets).liboliphaunt-native-desktop, 'database-resources:build-native-standard') || contains(fromJson(inputs.job-targets).liboliphaunt-native-desktop, 'database-resources:build-native-icu') }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: database-resources-native-seeds-${{ matrix.target }}
path: target/database-resources/release-assets/*-seed-native-${{ matrix.target }}-*
if-no-files-found: error
- name: Show native compiler cache stats
if: ${{ always() }}
env:
NATIVE_TARGET: ${{ matrix.target }}
run: |
if [[ "$NATIVE_TARGET" != windows-* ]] && command -v ccache >/dev/null 2>&1; then
ccache --show-stats
fi
- name: Upload liboliphaunt build logs
if: ${{ failure() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: liboliphaunt-logs-${{ matrix.target }}
path: |
${{ matrix.build-root }}/*.log
target/liboliphaunt/**/*.log
if-no-files-found: ignore