Skip to content

Commit 41c9f67

Browse files
committed
Testing the workflow for cmake-multi
1 parent cc7295d commit 41c9f67

File tree

1 file changed

+15
-35
lines changed

1 file changed

+15
-35
lines changed
Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
2-
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
1+
#Testing
32

43
name: CMake on multiple platforms
54

65
on:
7-
# Keep it for manual runs.
86
workflow_dispatch:
9-
# Run it on all branches but ignore some paths.
107
pull_request:
118
paths:
12-
- 'inflection/**'
13-
- '.github/workflows/**'
14-
- '!data/**'
15-
- '!documents/**'
16-
- '!fst/**'
17-
# Run the build when we merge into main
9+
- 'inflection/**'
10+
- '.github/workflows/**'
11+
- '!data/**'
12+
- '!documents/**'
13+
- '!fst/**'
1814
push:
1915
branches:
2016
- main
2117
paths:
2218
- 'inflection/**'
2319
- '.github/workflows/**'
20+
2421
env:
2522
ICU_MAJOR: '77'
2623
ICU_MINOR: '1'
@@ -41,16 +38,10 @@ jobs:
4138
export ICU=~/icu/
4239
mkdir -p $ICU
4340
echo "ICU directory is $ICU"
44-
45-
# Get the release and unpack.
4641
cp icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU
4742
pushd $ICU
48-
49-
pwd
50-
5143
tar xvfz *.tgz
5244
rm *.tgz
53-
5445
- uses: actions/cache/save@v4
5546
with:
5647
path: ~/icu
@@ -59,25 +50,16 @@ jobs:
5950
build:
6051
needs: cache-icu
6152
runs-on: ${{ matrix.os }}
62-
6353
strategy:
64-
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
6554
fail-fast: false
66-
67-
# Set up a matrix to run the following configurations:
68-
# 1. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
69-
#
70-
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
7155
matrix:
7256
os: [ubuntu-latest, macos-latest]
7357
build_type: [Release]
7458
c_compiler: [clang]
75-
# All [OS x compiler] items should be covered in include/exclude sections.
7659
include:
7760
- os: ubuntu-latest
7861
c_compiler: clang
7962
cpp_compiler: clang++
80-
8163
- os: macos-latest
8264
c_compiler: clang
8365
cpp_compiler: clang++
@@ -106,51 +88,49 @@ jobs:
10688
if: steps.lfscache.outputs.cache-hit != 'true'
10789
run: git lfs checkout
10890

109-
- name: Check LFS restore the files or not after checkout
91+
- name: Check LFS restored files
11092
run: ls -l inflection/resources/org/unicode/inflection/dictionary/*
11193

11294
- name: Set reusable strings
113-
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
11495
id: strings
11596
shell: bash
11697
run: |
11798
echo "project-root-dir=${{ github.workspace }}/inflection" >> "$GITHUB_OUTPUT"
11899
echo "build-output-dir=${{ github.workspace }}/inflection/build" >> "$GITHUB_OUTPUT"
119-
100+
echo "inflection-test-data-dir=${{ github.workspace }}/inflection/resources/org/unicode/inflection/dictionary" >> "$GITHUB_OUTPUT"
101+
120102
- uses: actions/cache/restore@v4
121103
id: cache
122104
with:
123105
path: ~/icu
124106
key: ${{ runner.os }}-icu-${ICU_MAJOR}-${ICU_MINOR}
125107

126-
# Install all the required dependencies for the macos
127108
- name: Install ICU (Ubuntu/macos)
128109
run: |
129110
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
130-
echo "ICU_ROOT=~/icu/icu/usr/local" >> $GITHUB_ENV
111+
echo "ICU_ROOT=$HOME/icu/icu/usr/local" >> $GITHUB_ENV
131112
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
132-
brew list icu4c || brew install icu4c
133-
echo "ICU_ROOT=$(brew --prefix icu4c)" >> $GITHUB_ENV
113+
brew list icu4c || brew install icu4c
114+
echo "ICU_ROOT=$(brew --prefix icu4c)" >> $GITHUB_ENV
134115
fi
135116
136117
- name: Configure CMake
137-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
138-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
139118
run: >
140119
cmake -B ${{ steps.strings.outputs.build-output-dir }}
141120
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
142121
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
143122
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
123+
-DINFLECTION_TEST_DATA_DIR=${{ steps.strings.outputs.inflection-test-data-dir }}
144124
-S ${{ steps.strings.outputs.project-root-dir }}
145125
146126
- name: Get number of CPU cores
147127
uses: SimenB/github-actions-cpu-cores@v2
148128
id: cpu-cores
149129

150130
- name: Build
151-
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
152131
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j ${{ steps.cpu-cores.outputs.count }}
153132

154133
- name: Test
155134
working-directory: ${{ steps.strings.outputs.build-output-dir }}
156135
run: cmake --build . -t check -j ${{ steps.cpu-cores.outputs.count }}
136+

0 commit comments

Comments
 (0)