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

github-actions - add atomic-commits check #18

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Install Dependencies'
description: 'Install required dependencies in container'

inputs:
clang-tools:
description: 'Install clang & clang-tools-extra'
required: false
default: false

runs:
using: 'composite'
steps:
- name: Install build dependencies
shell: bash
run: |
dnf install -y make gcc-c++ cmake3 git rpm-build fuse3-devel
- name: Install clang tools
if: ${{ inputs.clang-tools == 'true' }}
shell: bash
run: |
dnf install -y clang clang-tools-extra
25 changes: 25 additions & 0 deletions .github/workflows/atomic-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: check-atomic-commits

on: pull_request

jobs:
atomic-commits:
runs-on: ubuntu-latest
container: oraclelinux:9
steps:
- name: Install git
run: dnf install -y git
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Mark github workspace as safe
run: git config --system --add safe.directory $PWD
- name: List commits and run make for each
run: |
git rev-list --reverse ${{ github.event.pull_request.base.sha }}..HEAD | while read commit; do
git checkout $commit
make
done
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ jobs:
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: Install git
run: dnf install -y git
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Mark github workspace as safe
run: git config --system --add safe.directory $PWD
- name: make
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
- 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
uses: ./.github/actions/install-dependencies
with:
clang-tools: true
- name: make format-check
run: make format
- name: make tidy-check
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/copr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: release package on copr

on:
on:
push:
branches:
- release
Expand All @@ -10,22 +10,26 @@ jobs:
runs-on: ubuntu-latest
container: oraclelinux:8
steps:
- name: Install git
run: dnf install -y git
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Install copr-cli
run: |
dnf install -y dnf-plugins-core epel-release
dnf -y copr enable @CESNET/NEMEA
dnf install -y make gcc-c++ cmake3 git rpm-build fuse3-devel copr-cli
- name: Check out repository code
uses: actions/checkout@v4
dnf install -y copr-cli
- name: Mark github workspace as safe
run: git config --system --add safe.directory $PWD
- name: make rpm
run: make rpm
- name: Create copr config
run: |
mkdir ~/.config
echo "${{ secrets.COPR_CONFIG }}" >> ~/.config/copr
- name: Upload SRPM to copr
echo "${{ secrets.COPR_CONFIG }}" >> ~/.config/copr
- name: Upload SRPM to copr
run: |
copr build @CESNET/NEMEA build/pkg/rpm/rpmbuild/SRPMS/*
copr build @CESNET/NEMEA-stable build/pkg/rpm/rpmbuild/SRPMS/*