forked from ryzom/ryzomcore
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (113 loc) · 4.16 KB
/
ci-snowballs.yml
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
119
120
121
122
123
124
125
126
127
128
129
130
name: "Snowballs: CI / CD"
on:
push:
branches: [ "core4", "feature/*" ]
paths:
- .github/workflows/ci-snowballs.yml
- snowballs2/**
- CMakeLists.txt
- CMakePresets.json
pull_request:
branches: [ "core4" ]
paths:
- .github/workflows/ci-snowballs.yml
- snowballs2/**
- CMakeLists.txt
- CMakePresets.json
jobs:
strings:
runs-on: ubuntu-latest
outputs:
build-dir: ${{ steps.strings.outputs.build-dir }}
install-dir: ${{ steps.strings.outputs.install-dir }}
build-version: ${{ steps.strings.outputs.build-version }}
project-name: ${{ steps.strings.outputs.project-name }}
steps:
- name: Set reusable strings
id: strings
shell: bash
run: |
BUILD_DIR=${{ github.workspace }}/build
echo "build-output-dir=${BUILD_DIR}" >> "$GITHUB_OUTPUT"
echo "build-dir=${BUILD_DIR}" >> "$GITHUB_OUTPUT"
echo "install-dir=${BUILD_DIR}/install" >> "$GITHUB_OUTPUT"
COMMIT_HASH=${{ github.sha }}
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
VERSION="$VERSION+sha.${COMMIT_HASH:0:8}"
echo VERSION=$VERSION
echo "build-version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "project-name=snowballs" >> "$GITHUB_OUTPUT"
build:
needs: [ strings ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
include:
- os: ubuntu-22.04
preset: linux-${{ needs.strings.outputs.project-name }}
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11.5
- name: Dependencies Linux
if: runner.os == 'Linux'
run: |
sudo apt install --yes \
build-essential ccache \
bison autoconf automake \
libpng-dev \
libjpeg-dev \
libgif-dev libfreetype6-dev \
freeglut3-dev \
liblua5.2-dev libluabind-dev libcpptest-dev \
libogg-dev libvorbis-dev libopenal-dev \
libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev \
libmysqlclient-dev \
libcurl4-openssl-dev libssl-dev \
libsquish-dev \
liblzma-dev \
libgsf-1-dev \
qtbase5-dev qttools5-dev qttools5-dev-tools \
- uses: dawidd6/action-download-artifact@v6
id: download-from-branch
with:
workflow: ci-nel.yml
workflow_conclusion: success
branch: "${{ github.ref }}"
event: push
name: package-nel-.*
name_is_regexp: true
path: build
if_no_artifact_found: ignore
- uses: dawidd6/action-download-artifact@v6
if: ${{ ! steps.download-from-branch.outputs.found_artifact }}
with:
workflow: ci-nel.yml
workflow_conclusion: success
branch: "core4"
event: push
name: package-nel-.*
name_is_regexp: true
path: build
- name: Install Dependency
run: >
sh ${{ needs.strings.outputs.build-dir }}/package-nel-*/nel-*.sh
--skip-license
--include-subdir
--prefix=${{ needs.strings.outputs.install-dir }}
- run: find ${{ needs.strings.outputs.install-dir }}
- name: Configure CMake
run: cmake --preset ${{ matrix.preset }}
- name: Build
run: cmake --build --preset ${{ needs.strings.outputs.project-name }}
- name: Test
run: ctest --preset ${{ needs.strings.outputs.project-name }}
- name: Package
run: cpack --preset ${{ needs.strings.outputs.project-name }} -R "${{ needs.strings.outputs.build-version }}"
- uses: actions/upload-artifact@v4
with:
name: package-${{ needs.strings.outputs.project-name }}-${{ matrix.os }}-${{ needs.strings.outputs.build-version }}
path: ${{ needs.strings.outputs.build-dir }}/${{ needs.strings.outputs.project-name }}-*