mirror of
https://github.com/threeal/cmake-action.git
synced 2025-07-26 07:44:23 +00:00
commit
c1a039da72
19
.github/workflows/test.yml
vendored
Normal file
19
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: test
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
jobs:
|
||||
use-action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3.3.0
|
||||
|
||||
- name: Move test project to the working directory
|
||||
run: mv test/* .
|
||||
|
||||
- name: Use this action
|
||||
uses: ./
|
||||
|
||||
- name: Run build result
|
||||
run: ./build/hello_world
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
build
|
16
action.yml
Normal file
16
action.yml
Normal file
@ -0,0 +1,16 @@
|
||||
name: CMake Action
|
||||
description: Configure and build CMake project
|
||||
author: Alfi Maulana
|
||||
branding:
|
||||
color: gray-dark
|
||||
icon: terminal
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Configure CMake
|
||||
shell: bash
|
||||
run: cmake . -B build
|
||||
|
||||
- name: Build targets
|
||||
shell: bash
|
||||
run: cmake --build build
|
3
test/CMakeLists.txt
Normal file
3
test/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(test)
|
||||
add_executable(hello_world hello_world.cpp)
|
6
test/hello_world.cpp
Normal file
6
test/hello_world.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello world!" << std::endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user