Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Github actions to do ubuntu build #155

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4ec6860
Test Github actions to do ubuntu build
pboyd04 Sep 16, 2021
212fb7f
Update cmake.yml
pboyd04 Sep 16, 2021
8ce751d
Test windows build
pboyd04 Sep 16, 2021
7129551
Update cmake.yml
pboyd04 Sep 16, 2021
f13e554
Move windows build steps from script to steps
pboyd04 Sep 16, 2021
32d990b
Update cmake.yml
pboyd04 Sep 16, 2021
ba34a72
Update cmake.yml
pboyd04 Sep 16, 2021
183ca0e
Add windows check for local curl files
pboyd04 Sep 16, 2021
5966991
Update cmake.yml
pboyd04 Sep 16, 2021
f2ee300
Update cmake.yml
pboyd04 Sep 16, 2021
f20a6e3
Update CMakeLists.txt
pboyd04 Sep 16, 2021
85cbcb1
Update cmake.yml
pboyd04 Sep 16, 2021
51740ae
Update cmake.yml
pboyd04 Sep 16, 2021
f9e69c4
Update cmake.yml
pboyd04 Sep 16, 2021
c5c8ff9
Update cmake.yml
pboyd04 Sep 16, 2021
76d8b75
Update cmake.yml
pboyd04 Sep 16, 2021
106a2fe
package-bin.yaml
pboyd04 Sep 17, 2021
f543938
Update cmake.yml
pboyd04 Sep 17, 2021
f337f63
Update cmake.yml
pboyd04 Sep 17, 2021
76f5d4f
Update cmake.yml
pboyd04 Sep 17, 2021
791b0f9
Update package-bin.yaml
pboyd04 Sep 17, 2021
9e05285
Create package-dev.yaml
pboyd04 Sep 17, 2021
7a857a0
Update cmake.yml
pboyd04 Sep 17, 2021
486fa68
Update cmake.yml
pboyd04 Sep 17, 2021
848dbfb
Update cmake.yml
pboyd04 Sep 17, 2021
8d9646e
Update cmake.yml
pboyd04 Sep 17, 2021
c3266e6
Disable RPM build for now
pboyd04 Sep 17, 2021
699b91c
Rename cmake.yml to pull.yml
pboyd04 Sep 17, 2021
a1e607f
Update pull.yml
pboyd04 Sep 17, 2021
01fef8d
Create release.yml
pboyd04 Sep 17, 2021
5ee894a
Merge branch 'main' into GithubActions
pboyd04 Jul 27, 2023
2cf4c03
Create build.yml
pboyd04 Jul 27, 2023
1d5905e
Update build.yml
pboyd04 Jul 27, 2023
6b3c539
Update build.yml
pboyd04 Jul 27, 2023
0a36df2
Update build.yml
pboyd04 Jul 27, 2023
badd26f
Update build.yml
pboyd04 Jul 27, 2023
c9e653b
Update build.yml
pboyd04 Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [ published ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: olegtarasov/[email protected]
id: tagName

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libjansson-dev libcurl4-openssl-dev libreadline-dev

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- uses: kentik/[email protected]
if: ${{ github.event_name == 'release' }}
with:
name: libredfish-${{ matrix.os }}
version: ${{ env.GIT_TAG_NAME }}
arch: 'x86_64'
format: 'deb'
package: package-bin.yaml

- uses: kentik/[email protected]
if: ${{ github.event_name == 'release' }}
with:
name: libredfish-dev-${{ matrix.os }}
version: ${{ env.GIT_TAG_NAME }}
arch: 'x86_64'
format: 'deb'
package: package-dev.yaml

# - name: build RPM package
# id: rpm_build
# uses: naveenrajm7/rpmbuild@master
# with:
# spec_file: rpm/libredfish.spec

- uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'release' }}
with:
files: ./*.deb

# - uses: softprops/action-gh-release@v1
# with:
# files: ./*.rpm


# build-windows-x64:
# runs-on: windows-latest

# steps:
# - uses: actions/checkout@v2
# - uses: olegtarasov/[email protected]
# id: tagName

# - name: Get Curl
# run: |
# Invoke-WebRequest -Uri https://curl.se/windows/latest.cgi?p=win64-mingw.zip -OutFile curl.zip
# Expand-Archive curl.zip
# Move-Item .\curl\*\* .\curl\
# Copy-Item .\curl\lib\libcurl.dll.a .\curl\lib\curl.lib

# - name: Get Jansson
# run: |
# Invoke-WebRequest -OutFile jansson.lib -Uri https://github.com/pboyd04/jansson/releases/download/v2.11/janssonx64.lib
# Invoke-WebRequest -OutFile include/jansson.h -Uri https://github.com/pboyd04/jansson/releases/download/v2.11/jansson.h
# Invoke-WebRequest -OutFile include/jansson_config.h -Uri https://github.com/pboyd04/jansson/releases/download/v2.11/jansson_config.h

# - name: Get getopt.h
# run: Invoke-WebRequest -OutFile include/getopt.h -Uri https://raw.githubusercontent.com/skandhurkat/Getopt-for-Visual-Studio/master/getopt.h

# - name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
# run: cmake -A x64 -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DJANSSON_LIBRARIES=./jansson.lib -DJANSSON_INCLUDE_DIRS=./

# - name: Build
# Build your program with the given configuration
# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

# - name: Compress artifacts
# run: Compress-Archive .\build\bin\Release\* -DestinationPath .\build\libredfish-${{ env.GIT_TAG_NAME }}-x64.zip

# - name: Archive production artifacts
# uses: softprops/action-gh-release@v1
# with:
# files: ${{github.workspace}}\build\libredfish-${{ env.GIT_TAG_NAME }}-x64.zip
115 changes: 115 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Pull Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
#Default tag name
GIT_TAG_NAME: '0.0.1'

jobs:
build-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]

steps:
- uses: actions/checkout@v2
- uses: olegtarasov/[email protected]
id: tagName

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libjansson-dev libcurl4-openssl-dev libreadline-dev

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- uses: kentik/[email protected]
with:
name: libredfish
version: ${{ env.GIT_TAG_NAME }}
arch: 'x86_64'
format: 'deb'
package: package-bin.yaml

- uses: kentik/[email protected]
with:
name: libredfish-dev
version: ${{ env.GIT_TAG_NAME }}
arch: 'x86_64'
format: 'deb'
package: package-dev.yaml

# - name: build RPM package
# id: rpm_build
# uses: naveenrajm7/rpmbuild@master
# with:
# spec_file: rpm/libredfish.spec

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: ./*.deb

# - uses: actions/upload-artifact@v2
# with:
# name: RPM
# path: ./*.rpm


build-windows-x64:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
- uses: olegtarasov/[email protected]
id: tagName

- name: Get Curl
run: |
Invoke-WebRequest -Uri https://curl.se/windows/dl-7.76.1/curl-7.76.1-win64-mingw.zip -OutFile curl.zip
Expand-Archive curl.zip
Move-Item .\curl\*\* .\curl\
Copy-Item .\curl\lib\libcurl.dll.a .\curl\lib\curl.lib

- name: Get Jansson
run: |
Invoke-WebRequest -OutFile jansson.lib -Uri https://github.com/pboyd04/jansson/releases/download/v2.11/janssonx64.lib
Invoke-WebRequest -OutFile include/jansson.h -Uri https://github.com/pboyd04/jansson/releases/download/v2.11/jansson.h
Invoke-WebRequest -OutFile include/jansson_config.h -Uri https://github.com/pboyd04/jansson/releases/download/v2.11/jansson_config.h

- name: Get getopt.h
run: Invoke-WebRequest -OutFile include/getopt.h -Uri https://raw.githubusercontent.com/skandhurkat/Getopt-for-Visual-Studio/master/getopt.h

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -A x64 -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DJANSSON_LIBRARIES=./jansson.lib -DJANSSON_INCLUDE_DIRS=./

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Compress artifacts
run: Compress-Archive .\build\bin\Release\* -DestinationPath .\build\libredfish-${{ env.GIT_TAG_NAME }}-x64.zip

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: windows-x64
path: ${{github.workspace}}\build\libredfish-${{ env.GIT_TAG_NAME }}-x64.zip

7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ file(GLOB REDFISH_SRC src/*.c src/entities/*.c)

source_group("Library Sources" FILES ${REDFISH_SRC})

if (WIN32)
set(CURL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/curl/include)
set(CURL_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/curl.lib)
set(JANSSON_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/jansson.lib)
set(JANSSON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
endif()

find_package(CURL REQUIRED)
find_package(Jansson REQUIRED)
find_package(CZMQ)
Expand Down
17 changes: 17 additions & 0 deletions package-bin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
meta:
description: libredfish
vendor: DMTF
maintainer: [email protected]
files:
"/usr/lib64/libredfish.so":
file: build/lib/libredfish.so
mode: "0755"
user: "root"
"/usr/bin/redfishcli":
file: build/bin/redfishcli
mode: "0755"
user: "root"
"/usr/bin/redfishtest":
file: build/bin/redfishtest
mode: "0755"
user: "root"
37 changes: 37 additions & 0 deletions package-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
meta:
description: libredfish-dev
vendor: DMTF
maintainer: [email protected]
files:
"/usr/include/libredfish/redfish.h":
file: include/redfish.h
mode: "0644"
user: "root"
"/usr/include/libredfish/redfishEvent.h":
file: include/redfishEvent.h
mode: "0644"
user: "root"
"/usr/include/libredfish/redfishPayload.h":
file: include/redfishPayload.h
mode: "0644"
user: "root"
"/usr/include/libredfish/redfishRawAsync.h":
file: include/redfishRawAsync.h
mode: "0644"
user: "root"
"/usr/include/libredfish/redfishService.h":
file: include/redfishService.h
mode: "0644"
user: "root"
"/usr/include/libredfish/redpath.h":
file: include/redpath.h
mode: "0644"
user: "root"
"/usr/include/libredfish/entities/chassis.h":
file: include/entities/chassis.h
mode: "0644"
user: "root"
"/usr/include/libredfish/entities/resource.h":
file: include/entities/resource.h
mode: "0644"
user: "root"