summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Paul <n@nc0.fr>2023-04-25 15:34:51 +0200
committerNicolas Paul <n@nc0.fr>2023-04-25 15:34:51 +0200
commitaee2eadbb85eb1a76faf5cad58b6c3bc92ae34e3 (patch)
tree9214efadf58c03156ae15ac19386dfd75525aaac
parente9742bed5165ed602e5aec9a21430c593a2b8ab5 (diff)
Add CI
-rw-r--r--.github/workflows/ci.yml38
-rw-r--r--README (renamed from README.md)0
-rw-r--r--crocc.go4
-rwxr-xr-xtools/addlicense.sh6
-rwxr-xr-xtools/check_addlicense.sh6
-rwxr-xr-xtools/check_goimports.sh6
-rwxr-xr-xtools/goimports.sh6
7 files changed, 66 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..6e698c0
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,38 @@
+# Copyright (c) 2023 Nicolas Paul All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+name: Continuous Integration
+on:
+ push:
+jobs:
+ go:
+ name: Golang CI
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 5
+ strategy:
+ matrix:
+ go:
+ - 1.19
+ - 1.20
+ os:
+ - ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ name: Cloning repository
+ - uses: actions/setup-go@v4
+ name: Installing Go ${{ matrix.go_version }}
+ with:
+ go-version: ${{ matrix.go_version }}
+ - name: Building project
+ run: go build -race -v -o=crocc .
+ - name: Testing project
+ run: go test
+ - name: Downloading CI dependencies
+ run: |
+ go install golang.org/x/tools/cmd/goimports@latest
+ go install github.com/google/addlicense@latest
+ - name: Check formatting
+ run: ./tools/check_goimports.sh
+ - name: Check license headers
+ run: ./tools/check_addlicense.sh
diff --git a/README.md b/README
index f0ac901..f0ac901 100644
--- a/README.md
+++ b/README
diff --git a/crocc.go b/crocc.go
index f27ccf4..ecf7544 100644
--- a/crocc.go
+++ b/crocc.go
@@ -1,2 +1,6 @@
+// Copyright (c) 2023 Nicolas Paul All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
// Package crocc is a simple Markdown-based static site generator.
package crocc
diff --git a/tools/addlicense.sh b/tools/addlicense.sh
new file mode 100755
index 0000000..f8ab42f
--- /dev/null
+++ b/tools/addlicense.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# Copyright (c) 2023 Nicolas Paul All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+addlicense -c="Nicolas Paul" -l=bsd -v -y=2023 . \ No newline at end of file
diff --git a/tools/check_addlicense.sh b/tools/check_addlicense.sh
new file mode 100755
index 0000000..ff4c0ec
--- /dev/null
+++ b/tools/check_addlicense.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# Copyright (c) 2023 Nicolas Paul All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+addlicense -c="Nicolas Paul" -l=bsd -v -y=2023 --check . \ No newline at end of file
diff --git a/tools/check_goimports.sh b/tools/check_goimports.sh
new file mode 100755
index 0000000..c15b914
--- /dev/null
+++ b/tools/check_goimports.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# Copyright (c) 2023 Nicolas Paul All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+goimports -e -d -l . \ No newline at end of file
diff --git a/tools/goimports.sh b/tools/goimports.sh
new file mode 100755
index 0000000..90695ab
--- /dev/null
+++ b/tools/goimports.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# Copyright (c) 2023 Nicolas Paul All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+goimports -e -w -l . \ No newline at end of file