-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CESNET/github-actions
Introduce GitHub-actions workflow
- Loading branch information
Showing
5 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: ${{ inputs.os }} | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
dnf install -y make gcc-c++ cmake3 git rpm-build fuse3-devel | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Mark github workspace as safe | ||
run: git config --system --add safe.directory $PWD | ||
- name: make | ||
run: make | ||
- name: make rpm | ||
run: make rpm | ||
- name: make install | ||
run: make install | ||
- name: extract artifact name | ||
run: | | ||
OS=${{ inputs.os }} | ||
echo "artifactName=$(echo ${OS/:/}-rpm)" >> $GITHUB_ENV | ||
- name: upload RPM artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.artifactName }} | ||
path: ./build/pkg/rpm/rpmbuild/RPMS/x86_64 | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: check | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
clang-checks: | ||
runs-on: ubuntu-latest | ||
container: oraclelinux:9 | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
dnf install -y make gcc-c++ clang clang-tools-extra cmake3 git rpm-build fuse3-devel | ||
- name: make format-check | ||
run: make format | ||
- name: make tidy-check | ||
run: make tidy | ||
|
||
editor-config: | ||
runs-on: ubuntu-latest | ||
container: mstruebing/editorconfig-checker | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Check editorconfig | ||
run: ec --exclude .git | ||
|
||
include-orders: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Run include-order-checker | ||
run: "! grep -r -A 10 '#include <' src/ include/ | grep -B 10 '#include \"'" | ||
|
||
cppcheck: | ||
uses: ./.github/workflows/cppcheck.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Continuous Integration pipeline | ||
|
||
on: push | ||
|
||
jobs: | ||
check: | ||
uses: ./.github/workflows/check.yml | ||
build-os-matrix: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
outputs: | ||
os: ${{ steps.os.outputs.os }} | ||
steps: | ||
- name: Build OS Array | ||
id: os | ||
run: | | ||
osArray=() | ||
osArray+=("rockylinux:9") | ||
osArray+=("oraclelinux:8") | ||
osArray+=("oraclelinux:9") | ||
osArray+=("fedora:38") | ||
osArray=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${osArray[@]}") | ||
echo "Updated os list: $osArray" | ||
echo "os=$osArray" >> $GITHUB_OUTPUT | ||
build: | ||
needs: [build-os-matrix] | ||
strategy: | ||
matrix: | ||
os: ${{ fromJSON(needs.build-os-matrix.outputs.os) }} | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: ${{ matrix.os }} | ||
rpm-test: | ||
needs: [build-os-matrix, build] | ||
strategy: | ||
matrix: | ||
os: ${{ fromJSON(needs.build-os-matrix.outputs.os) }} | ||
uses: ./.github/workflows/rpm-test.yml | ||
with: | ||
os: ${{ matrix.os }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: cppcheck-action-test | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
build: | ||
name: cppcheck-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: cppcheck | ||
uses: SiskaPavel/cppcheck-action@main | ||
with: | ||
std: c++17 | ||
inline_suppression: enable | ||
output_file: 'cppcheck_report.txt' | ||
enable: warning,performance,portability,style,information | ||
other_options: --error-exitcode=1 | ||
- name: Print cppcheck_report.txt | ||
if: failure() | ||
run: cat cppcheck_report.txt | ||
- name: Upload Artifact | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cppcheck_report | ||
path: 'cppcheck_report.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: ${{ inputs.os }} | ||
steps: | ||
- name: extract artifact name | ||
run: | | ||
OS=${{ inputs.os }} | ||
echo "artifactName=$(echo ${OS/:/}-rpm)" >> $GITHUB_ENV | ||
- name: download RPM artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ env.artifactName }} | ||
- name: install RPM artifact | ||
run: | | ||
dnf install -y *.rpm |