Skip to content

Commit e4bd663

Browse files
committed
CI: Move linux unit test to separate build step
1 parent b25276d commit e4bd663

File tree

6 files changed

+86
-20
lines changed

6 files changed

+86
-20
lines changed

.ci/build-linux-aarch64.sh

+17-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@ fi
66

77
shellcheck .ci/*.sh
88

9+
RPCS3_DIR=$(pwd)
10+
11+
# If we're building using a CI, let's use the runner's directory
12+
if [ -n "$BUILDDIR" ]; then
13+
BUILD_DIR="$BUILDDIR"
14+
else
15+
BUILD_DIR="$RPCS3_DIR/build"
16+
fi
17+
918
git config --global --add safe.directory '*'
1019

1120
# Pull all the submodules except llvm, opencv, sdl and curl
1221
# shellcheck disable=SC2046
1322
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/libsdl-org/ && !/curl/ { print $3 }' .gitmodules)
1423

15-
mkdir build && cd build || exit 1
24+
if [ ! -d "$BUILD_DIR" ]; then
25+
mkdir "$BUILD_DIR" || exit 1
26+
fi
27+
28+
cd "$BUILD_DIR" || exit 1
1629

1730
if [ "$COMPILER" = "gcc" ]; then
1831
# These are set in the dockerfile
@@ -27,7 +40,7 @@ fi
2740

2841
export LINKER_FLAG="-fuse-ld=${LINKER}"
2942

30-
cmake .. \
43+
cmake "$RPCS3_DIR" \
3144
-DCMAKE_INSTALL_PREFIX=/usr \
3245
-DUSE_NATIVE_INSTRUCTIONS=OFF \
3346
-DUSE_PRECOMPILED_HEADERS=OFF \
@@ -43,13 +56,13 @@ cmake .. \
4356
-DOpenGL_GL_PREFERENCE=LEGACY \
4457
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
4558
-DSTATIC_LINK_LLVM=ON \
46-
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
59+
-DBUILD_RPCS3_TESTS="${BUILD_UNIT_TESTS}" \
4760
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
4861
-G Ninja
4962

5063
ninja; build_status=$?;
5164

52-
cd ..
65+
cd "$RPCS3_DIR"
5366

5467
# If it compiled succesfully let's deploy.
5568
# Azure and Cirrus publish PRs as artifacts only.

.ci/build-linux.sh

+21-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,27 @@ fi
66

77
shellcheck .ci/*.sh
88

9+
RPCS3_DIR=$(pwd)
10+
11+
# If we're building using a CI, let's use the runner's directory
12+
if [ -n "$BUILDDIR" ]; then
13+
BUILD_DIR="$BUILDDIR"
14+
else
15+
BUILD_DIR="$RPCS3_DIR/build"
16+
fi
17+
918
git config --global --add safe.directory '*'
1019

1120
# Pull all the submodules except llvm, opencv, sdl and curl
1221
# Note: Tried to use git submodule status, but it takes over 20 seconds
1322
# shellcheck disable=SC2046
1423
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/libsdl-org/ && !/curl/ { print $3 }' .gitmodules)
1524

16-
mkdir build && cd build || exit 1
25+
if [ ! -d "$BUILD_DIR" ]; then
26+
mkdir "$BUILD_DIR" || exit 1
27+
fi
28+
29+
cd "$BUILD_DIR" || exit 1
1730

1831
if [ "$COMPILER" = "gcc" ]; then
1932
# These are set in the dockerfile
@@ -34,7 +47,7 @@ fi
3447

3548
export LINKER_FLAG="-fuse-ld=${LINKER}"
3649

37-
cmake .. \
50+
cmake "$RPCS3_DIR" \
3851
-DCMAKE_INSTALL_PREFIX=/usr \
3952
-DUSE_NATIVE_INSTRUCTIONS=OFF \
4053
-DUSE_PRECOMPILED_HEADERS=OFF \
@@ -54,19 +67,20 @@ cmake .. \
5467
-DOpenGL_GL_PREFERENCE=LEGACY \
5568
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
5669
-DSTATIC_LINK_LLVM=ON \
57-
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
70+
-DBUILD_RPCS3_TESTS="${BUILD_UNIT_TESTS}" \
5871
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
5972
-G Ninja
6073

6174
ninja; build_status=$?;
6275

63-
cd ..
76+
cd "$RPCS3_DIR"
6477

6578
# If it compiled succesfully let's deploy.
6679
# Azure and Cirrus publish PRs as artifacts only.
67-
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
68-
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
80+
# { [ "$CI_HAS_ARTIFACTS" = "true" ];
81+
# } && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
6982

7083
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
71-
.ci/deploy-linux.sh "x86_64"
84+
echo "deploy-linux placeholder"
85+
# .ci/deploy-linux.sh "x86_64"
7286
fi

.ci/deploy-linux.sh

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
#!/bin/sh -ex
22

3-
cd build || exit 1
3+
RPCS3_DIR=$(pwd)
4+
5+
echo "pwd = $RPCS3_DIR"
6+
ls -la -F
7+
8+
# If we're building using a CI, let's use the runner's directory
9+
if [ -n "$BUILDDIR" ]; then
10+
BUILD_DIR="$BUILDDIR"
11+
else
12+
BUILD_DIR="$RPCS3_DIR/build"
13+
fi
14+
echo "BUILD_DIR = $BUILD_DIR"
15+
16+
cd "$BUILD_DIR" || exit 1
17+
18+
echo "pwd = $(pwd)"
19+
ls -la -F
20+
21+
echo "cd $RPCS3_DIR/rpcs3"
22+
cd "$RPCS3_DIR/rpcs3"
23+
echo "pwd = $(pwd)"
24+
ls -la -F
425

526
CPU_ARCH="${1:-x86_64}"
627

.ci/docker.env

+3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ CI_HAS_ARTIFACTS
33
BUILD_REASON
44
BUILD_SOURCEVERSION
55
BUILD_ARTIFACTSTAGINGDIRECTORY
6+
BUILD_BUILDDIRECTORY
67
BUILD_REPOSITORY_NAME
78
BUILD_SOURCEBRANCHNAME
89
APPDIR
910
ARTDIR
11+
BUILDDIR
1012
RELEASE_MESSAGE
13+
BUILD_UNIT_TESTS
1114
RUN_UNIT_TESTS
1215
# Variables for build matrix
1316
COMPILER

.github/workflows/rpcs3.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919
BUILD_SOURCEBRANCHNAME: ${{ github.ref_name }}
2020
BUILD_SOURCEVERSION: ${{ github.sha }}
2121
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts/
22+
BUILD_BUILDDIRECTORY: ${{ github.workspace }}/rpcs3_build/
2223

2324
jobs:
2425
Linux_Build:
@@ -52,11 +53,13 @@ jobs:
5253
DEPLOY_APPIMAGE: true
5354
APPDIR: "/rpcs3/build/appdir"
5455
ARTDIR: "/root/artifacts"
56+
BUILDDIR: "/root/rpcs3_build"
5557
RELEASE_MESSAGE: "/rpcs3/GitHubReleaseMessage.txt"
5658
COMPILER: ${{ matrix.compiler }}
5759
UPLOAD_COMMIT_HASH: ${{ matrix.UPLOAD_COMMIT_HASH }}
5860
UPLOAD_REPO_FULL_NAME: ${{ matrix.UPLOAD_REPO_FULL_NAME }}
59-
RUN_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
61+
BUILD_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
62+
RUN_UNIT_TESTS: 'OFF'
6063
steps:
6164
- name: Checkout repository
6265
uses: actions/checkout@main
@@ -79,15 +82,27 @@ jobs:
7982
--env-file .ci/docker.env \
8083
-v ${{ env.CCACHE_DIR }}:/root/.ccache \
8184
-v ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}:${{ env.ARTDIR }} \
85+
-v ${{ env.BUILD_BUILDDIRECTORY }}:${{ env.BUILDDIR }} \
8286
${{ matrix.docker_img }} \
8387
${{ matrix.build_sh }}
8488
85-
- name: Upload artifacts
86-
uses: actions/upload-artifact@main
87-
with:
88-
name: RPCS3 for Linux (${{ runner.arch }}, ${{ matrix.compiler }})
89-
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.AppImage
90-
compression-level: 0
89+
- name: Unit tests
90+
if: github.event_name == 'pull_request'
91+
working-directory: ${{ github.workspace }}
92+
run: |
93+
ls -la -F
94+
ls -la -F rpcs3
95+
ctest -j -VV -C Release --test-dir "${{ env.BUILDDIR }}" --output-on-failure
96+
# mkdir -p my_symlinks
97+
# ln -s ${{ env.BUILDDIR }} my_symlinks/build
98+
# ctest -j -VV -C Release --test-dir my_symlinks/build --output-on-failure
99+
100+
# - name: Upload artifacts
101+
# uses: actions/upload-artifact@main
102+
# with:
103+
# name: RPCS3 for Linux (${{ runner.arch }}, ${{ matrix.compiler }})
104+
# path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.AppImage
105+
# compression-level: 0
91106

92107
- name: Deploy master build to GitHub Releases
93108
if: |

rpcs3/tests/test_fmt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace fmt
124124
EXPECT_EQ(lowercase, to_lower_res);
125125

126126
EXPECT_EQ(""s, fmt::to_upper(""));
127-
EXPECT_EQ(uppercase, fmt::to_upper(uppercase));
127+
EXPECT_EQ(uppercase, fmt::to_lower(uppercase));
128128
EXPECT_EQ(uppercase, to_upper_res);
129129
}
130130

0 commit comments

Comments
 (0)