Skip to content

Commit 52c969a

Browse files
authored
Merge pull request #68 from luavela/imun/purge-travis-ci
Refactor GitHub CI configurations
2 parents db552f9 + bd5bcba commit 52c969a

29 files changed

+247
-392
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Setup environment on Linux
2+
3+
Action encapsulates the workflow for LuaVela testing routine (configuration for
4+
the specified flavor, building, running smoke tests and running the whole
5+
testing routine).
6+
7+
## How to use Github Action from Github workflow
8+
9+
Add the following code to the running steps before uJIT configuration:
10+
```
11+
- uses: ./.github/actions/run-tests
12+
with:
13+
cmakeflags: >-
14+
-DCMAKE_BUILD_TYPE=Debug
15+
-DUJIT_ENABLE_COVERAGE=OFF
16+
-DUJIT_ENABLE_CO_TIMEOUT=OFF
17+
-DUJIT_ENABLE_GDBJIT=OFF
18+
-DUJIT_ENABLE_IPROF=OFF
19+
-DUJIT_ENABLE_MEMPROF=OFF
20+
-DUJIT_ENABLE_PROFILER=OFF
21+
-DUJIT_ENABLE_THREAD_SAFETY=OFF
22+
-DUJIT_HAS_FFI=OFF
23+
-DUJIT_HAS_JIT=OFF
24+
-DUJIT_LUA52COMPAT=OFF
25+
libtype: static
26+
toolchain: cmake/toolchain/Clang.cmake
27+
testopts: -O4
28+
```
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# GitHub CI configuration file for LuaVela.
2+
# Copyright (C) 2020-2024 LuaVela Authors. See Copyright Notice in COPYRIGHT
3+
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
4+
5+
name: LuaVela Testing
6+
description: Run LuaVela testing routine with the given flavor
7+
8+
inputs:
9+
cmakeflags:
10+
type: string
11+
required: false
12+
libtype:
13+
type: string
14+
required: false
15+
default: 'static'
16+
toolchain:
17+
type: string
18+
required: false
19+
testopts:
20+
type: string
21+
required: false
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- name: configure
27+
run: >-
28+
cmake -S . -B ${{ env.BUILDDIR }}
29+
${{ inputs.cmakeflags }}
30+
-DCMAKE_TOOLCHAIN_FILE=${{ inputs.toolchain }}
31+
-DUJIT_TEST_LIB_TYPE=${{ inputs.libtype }}
32+
-DUJIT_TEST_OPTIONS=${{ inputs.testopts }}
33+
shell: bash
34+
- name: build
35+
run: cmake --build . --parallel
36+
shell: bash
37+
working-directory: ${{ env.BUILDDIR }}
38+
- name: smoke
39+
run: cmake --build . --parallel --target tests_smoke
40+
shell: bash
41+
working-directory: ${{ env.BUILDDIR }}
42+
- name: test
43+
run: cmake --build . --parallel --target tests
44+
shell: bash
45+
working-directory: ${{ env.BUILDDIR }}

.github/actions/setup-linux/action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# GitHub CI configuration file for LuaVela.
2+
# Copyright (C) 2020-2024 LuaVela Authors. See Copyright Notice in COPYRIGHT
3+
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
4+
15
name: Setup CI environment on Linux
26
description: Common part to tweak Linux CI runner environment
37
runs:
@@ -11,11 +15,13 @@ runs:
1115
# limit the number of parallel jobs for build/test step.
1216
NPROC=$(nproc)
1317
echo CMAKE_BUILD_PARALLEL_LEVEL=$(($NPROC + 1)) | tee -a $GITHUB_ENV
18+
VERSION=$(grep -oP 'VERSION_ID="\K\d\d\.\d\d' /etc/os-release | tr . -)
19+
echo UBUNTU_VERSION=$VERSION | tee -a $GITHUB_ENV
1420
shell: bash
1521
- name: Install build and test dependencies
1622
run: |
1723
sudo apt -y update
18-
sudo xargs -a "./scripts/depends-build-20-04" apt install -y
19-
sudo xargs -a "./scripts/depends-test-20-04" apt install -y
20-
pip3 install --user -r ./scripts/requirements-tests.txt
24+
sudo xargs -a "./.github/bootstrap/build-depends-$UBUNTU_VERSION" apt install -y
25+
sudo xargs -a "./.github/bootstrap/test-depends-$UBUNTU_VERSION" apt install -y
26+
pip3 install --user -r ./.github/bootstrap/test-requirements.txt
2127
shell: bash

.github/actions/setup-macos/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# GitHub CI configuration file for LuaVela.
2+
# Copyright (C) 2020-2024 LuaVela Authors. See Copyright Notice in COPYRIGHT
3+
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
4+
15
name: Setup CI environment on macOS
26
description: Common part to tweak macOS CI runner environment
37
runs:

.github/actions/setup/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# GitHub CI configuration file for LuaVela.
2+
# Copyright (C) 2020-2024 LuaVela Authors. See Copyright Notice in COPYRIGHT
3+
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
4+
15
name: Setup CI environment
26
description: Common part to tweak CI runner environment
37
runs:

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# GitHub CI configuration file for LuaVela.
2+
# Copyright (C) 2020-2024 LuaVela Authors. See Copyright Notice in COPYRIGHT
3+
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
4+
15
name: Lint
26

37
on:

0 commit comments

Comments
 (0)