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 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