-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We port over most of the GitLab pipelines to GitHub Actions. Missing is the coverage reporting for now. On the other side we add a package build step. This will allow CI consumers of Disman to directly install from this package when using Disman from master.
- Loading branch information
Showing
10 changed files
with
425 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,35 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Install Dependency via Artifact | ||
description: Uses tar package from other workflow to install on Arch | ||
inputs: | ||
repo: | ||
description: Path to repo where to download the dependency from | ||
required: true | ||
branch: | ||
description: Branch from which to download the artifact | ||
required: false | ||
default: master | ||
dep-name: | ||
description: Name of the dependency file | ||
required: true | ||
secret: | ||
description: Secret | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download artifact | ||
uses: dawidd6/action-download-artifact@v3 | ||
with: | ||
name: tar-package | ||
repo: ${{ inputs.repo }} | ||
branch: ${{ inputs.branch }} | ||
workflow_search: true | ||
github_token: ${{ inputs.secret }} | ||
- name: Untar | ||
run: tar -xf ${{ inputs.dep-name }}.tar.gz | ||
shell: bash | ||
- name: Install | ||
run: cp -r ${{ inputs.dep-name }}/* /usr | ||
shell: bash |
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,17 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Specialized Install Dependency via Artifact | ||
description: Calls into more generic dep-artifact-generic to install dependency | ||
inputs: | ||
secret: | ||
description: Secret | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Wrapland | ||
uses: ./.github/actions/dep-artifact-generic | ||
with: | ||
repo: winft/wrapland | ||
dep-name: wrapland | ||
secret: ${{ inputs.secret }} |
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,87 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Build | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
description: Image to build | ||
required: true | ||
type: string | ||
artifact-name: | ||
description: Artifact name of build dir | ||
required: false | ||
type: string | ||
default: 'build' | ||
is-sanitized: | ||
description: Should sanitizers be compiled into the build | ||
required: false | ||
type: boolean | ||
default: false | ||
ninja: | ||
description: Should Ninja be used as generator | ||
required: false | ||
type: boolean | ||
default: true | ||
cmake-args: | ||
description: Specify CMake arguments manually | ||
required: false | ||
type: string | ||
default: '' | ||
jobs: | ||
set-cmake-args: | ||
name: CMake Args | ||
runs-on: ubuntu-latest | ||
env: | ||
cmake-args: '' | ||
outputs: | ||
args: ${{ steps.set-output.outputs.result }} | ||
steps: | ||
- name: Set from manually specified CMake args | ||
if: ${{ inputs.cmake-args != '' }} | ||
run: echo \"cmake-args=${{ inputs.cmake-args }}\" >> $GITHUB_ENV; | ||
- name: Set default CMake args for sanitized build | ||
if: ${{ inputs.cmake-args == '' && inputs.is-sanitized }} | ||
run: echo "cmake-args=-DECM_ENABLE_SANITIZERS='address;leak;undefined'" >> $GITHUB_ENV" | ||
- name: Set default CMake args for coverage build | ||
if: ${{ inputs.cmake-args == '' && !inputs.is-sanitized }} | ||
run: | ||
"echo \"cmake-args=-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage\" >> $GITHUB_ENV" | ||
- name: Set clang as compiler | ||
if: ${{ inputs.cmake-args == '' }} | ||
run: | ||
"echo \"cmake-args=-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ | ||
${{ env.cmake-args }}\" >> $GITHUB_ENV" | ||
- name: Set generator | ||
if: ${{ inputs.cmake-args == '' && inputs.ninja }} | ||
run: echo "cmake-args=-G Ninja ${{ env.cmake-args }}" >> $GITHUB_ENV | ||
- id: set-output | ||
name: Set resulting variable | ||
run: echo "result=${{ env.cmake-args }}" >> "$GITHUB_OUTPUT" | ||
build: | ||
name: Build | ||
needs: set-cmake-args | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.image }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Install Dependencies | ||
uses: ./.github/actions/dep-artifacts | ||
with: | ||
secret: ${{ secrets.GITHUB_TOKEN }} | ||
- run: mkdir build | ||
- name: Configure | ||
run: cmake -S . -B build ${{ needs.set-cmake-args.outputs.args }} | ||
- name: Build | ||
run: cmake --build build | ||
- name: Tar artifact (keep permissions) | ||
run: tar -czf build-dir.tar build | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: build-dir.tar | ||
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 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Main Checks | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
message-lint: | ||
uses: ./.github/workflows/commit-lint.yml | ||
with: | ||
upstream-repo: winft/disman | ||
|
||
clang-format: | ||
uses: ./.github/workflows/clang-format.yml | ||
|
||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
image: registry.gitlab.com/kwinft/ci-images/archlinux/frameworks-master | ||
|
||
install: | ||
uses: ./.github/workflows/install.yml | ||
needs: build | ||
with: | ||
image: registry.gitlab.com/kwinft/ci-images/archlinux/frameworks-master | ||
|
||
test: | ||
uses: ./.github/workflows/test.yml | ||
needs: build | ||
with: | ||
image: registry.gitlab.com/kwinft/ci-images/archlinux/frameworks-master | ||
|
||
package: | ||
uses: ./.github/workflows/package.yml | ||
needs: build | ||
with: | ||
image: registry.gitlab.com/kwinft/ci-images/archlinux/frameworks-master | ||
package-name: disman |
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,15 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Clang-Format | ||
on: workflow_call | ||
jobs: | ||
clang-format: | ||
name: Clang-Format | ||
runs-on: ubuntu-latest | ||
container: | ||
image: archlinux | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- run: pacman -Sy --needed --quiet --noconfirm clang python | ||
- run: bash tooling/analysis/clang-format.sh |
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,55 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Commit Message Lint | ||
on: | ||
workflow_call: | ||
inputs: | ||
upstream-repo: | ||
description: 'The repo with the target branch to compare against' | ||
required: true | ||
type: string | ||
upstream-branch: | ||
description: 'The target branch we compare against' | ||
required: false | ||
type: string | ||
default: 'master' | ||
env: | ||
upstream-repo-url: https://github.com/${{ inputs.upstream-repo }} | ||
jobs: | ||
message-lint: | ||
if: github.event_name != 'pull_request' | ||
name: On Push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Add Commitlint CLI | ||
run: yarn global add @commitlint/cli | ||
- name: Add Conventional Changelog module | ||
run: yarn add conventional-changelog-conventionalcommits | ||
|
||
# We must unshallow the checkout. On GitHub it's by default only 1 commit deep. | ||
- name: Unshallow | ||
run: git fetch --unshallow origin ${{ github.head_ref || github.ref_name }} | ||
|
||
- name: Add upstream remote | ||
run: git remote add _upstream ${{ env.upstream-repo-url }} | ||
- name: Fetch upstream | ||
run: git fetch --depth=1 -q _upstream ${{ inputs.upstream-branch }} | ||
- name: Commitlint | ||
run: > | ||
commitlint --verbose --config=tooling/docs/commitlint.config.js | ||
--from=_upstream/${{ inputs.upstream-branch }} | ||
message-lint-pr: | ||
if: github.event_name == 'pull_request' | ||
name: On Pull Request | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: wagoid/commitlint-github-action@v5 | ||
with: | ||
configFile: tooling/docs/commitlint.config.js | ||
helpURL: https://github.com/${{ inputs.upstream-repo }}/blob/master/CONTRIBUTING.md#commit-message-guideline |
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,32 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Build | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
description: Image to build | ||
required: true | ||
type: string | ||
artifact-name: | ||
description: Artifact name of build dir | ||
required: false | ||
type: string | ||
default: 'build' | ||
jobs: | ||
install: | ||
name: Install | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.image }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
- name: Untar artifact | ||
run: tar -xzf build-dir.tar | ||
- name: Try Install to System | ||
run: cmake --install build |
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,70 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Package | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
description: Image to package on | ||
required: true | ||
type: string | ||
artifact-name: | ||
description: Artifact name of build dir | ||
required: false | ||
type: string | ||
default: 'build' | ||
package-name: | ||
description: Name of the resulting packages | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
deb: | ||
name: Create deb | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.image }} | ||
steps: | ||
- name: Install dpkg | ||
run: pacman -Sy --needed --quiet --noconfirm dpkg | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
- name: Untar artifact | ||
run: tar -xzf build-dir.tar | ||
- name: Run CPack | ||
run: cd build && cpack -G DEB -D CPACK_DEBIAN_FILE_NAME=${{ inputs.package-name }}.deb | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: deb-package | ||
path: build/_CPack_Packages/Linux/DEB/${{ inputs.package-name }}.deb | ||
retention-days: 8 | ||
|
||
tar: | ||
name: Create tar | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.image }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
- name: Untar artifact | ||
run: tar -xzf build-dir.tar | ||
- name: Run CPack | ||
# Need to use CPACK_PACKAGE_FILE_NAME instead of CPACK_ARCHIVE_FILE_NAME | ||
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/20419 | ||
run: cd build && cpack -G TGZ -D CPACK_PACKAGE_FILE_NAME=${{ inputs.package-name }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tar-package | ||
path: build/_CPack_Packages/Linux/TGZ/${{ inputs.package-name }}.tar.gz | ||
retention-days: 8 |
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,19 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <subdiff@gmail.com> | ||
# SPDX-License-Identifier: MIT | ||
name: Weekly Project Rebuild | ||
on: | ||
schedule: | ||
- cron: '0 4 * * 4' | ||
jobs: | ||
build: | ||
if: github.repository == 'winft/disman' | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
image: registry.gitlab.com/kwinft/ci-images/archlinux/frameworks-master | ||
|
||
package: | ||
uses: ./.github/workflows/package.yml | ||
needs: build | ||
with: | ||
image: registry.gitlab.com/kwinft/ci-images/archlinux/frameworks-master | ||
package-name: disman |
Oops, something went wrong.