Merge pull request #1 from threeal/add-action

Add Action
This commit is contained in:
Alfi Maulana 2023-01-06 21:16:45 +07:00 committed by GitHub
commit c1a039da72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 0 deletions

19
.github/workflows/test.yml vendored Normal file
View 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
View File

@ -0,0 +1 @@
build

16
action.yml Normal file
View 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
View 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
View File

@ -0,0 +1,6 @@
#include <iostream>
int main() {
std::cout << "Hello world!" << std::endl;
return 0;
}