diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml new file mode 100644 index 0000000..6b9b95c --- /dev/null +++ b/.github/actions/install-dependencies/action.yml @@ -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 diff --git a/.github/workflows/atomic-commits.yml b/.github/workflows/atomic-commits.yml new file mode 100644 index 0000000..61fbefd --- /dev/null +++ b/.github/workflows/atomic-commits.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e66677..eb8a945 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 84b7a35..4a3c306 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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 diff --git a/.github/workflows/copr.yaml b/.github/workflows/copr.yaml index 1b4e501..1de5aeb 100644 --- a/.github/workflows/copr.yaml +++ b/.github/workflows/copr.yaml @@ -1,6 +1,6 @@ name: release package on copr -on: +on: push: branches: - release @@ -10,13 +10,17 @@ 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 @@ -24,8 +28,8 @@ jobs: - 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/*