Skip to content

Commit

Permalink
Merge pull request #18 from CESNET/ci-atomic-commits
Browse files Browse the repository at this point in the history
github-actions - add atomic-commits check
  • Loading branch information
SiskaPavel authored Oct 4, 2024
2 parents 0ea0c08 + a9b6d41 commit fa07656
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 11 deletions.
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/*

0 comments on commit fa07656

Please sign in to comment.