From de4b43d68cada7cef5ac31b4149f3a3f71b37bf0 Mon Sep 17 00:00:00 2001 From: Philipp Trulson Date: Tue, 20 Feb 2024 15:01:12 +0100 Subject: [PATCH 1/2] Add CI workflow --- .github/workflows/REUSE.yml | 14 +++++++++--- .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++++++++++++ Taskfile.yml | 8 +++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/REUSE.yml b/.github/workflows/REUSE.yml index 6ffe618..1873088 100644 --- a/.github/workflows/REUSE.yml +++ b/.github/workflows/REUSE.yml @@ -3,12 +3,20 @@ name: REUSE Compliance Check -on: [push, pull_request] +on: + push: + branches: [main] + pull_request: + types: [opened, reopened, synchronize] jobs: - test: + check_compliance: runs-on: ubuntu-latest + name: Run check + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + - name: REUSE Compliance Check uses: fsfe/reuse-action@v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..803e16e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: 2024 Serpent OS Developers +# SPDX-License-Identifier: CC0-1.0 + +name: Golang CI + +on: + push: + branches: [main] + pull_request: + types: [opened, reopened, synchronize] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + name: Build & Test + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.22' + + - name: Install Task + uses: arduino/setup-task@v2 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check formatting + run: | + task check_formatting + + - name: Build project + run: | + task build + build/libstone --version + + - name: Run tests + run: | + task check diff --git a/Taskfile.yml b/Taskfile.yml index 42a3ee1..6f97076 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -38,3 +38,11 @@ tasks: clean: cmds: - rm -rf {{.OUTPATH}} + + fmt: + cmds: + - gofmt -s -w . + + check_formatting: + cmds: + - test -z $(gofmt -l -s .) && exit 0 || gofmt -d -s .; exit 1 From 9c632a66956037d794a1cab3f614e78508427d92 Mon Sep 17 00:00:00 2001 From: Philipp Trulson Date: Tue, 20 Feb 2024 15:39:04 +0100 Subject: [PATCH 2/2] Add Codeowners file --- .github/CODEOWNERS | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..ae8d6bd --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2024 Serpent OS Developers +# SPDX-License-Identifier: CC0-1.0 + +* @der-eismann @GZGavinZhao @livingsilver94 @silkeh