From da3f4460797889a5b6a262f2e74424e3afe2b05d Mon Sep 17 00:00:00 2001 From: Wasuwee Sodsong Date: Tue, 9 Apr 2024 18:06:52 +0700 Subject: [PATCH 1/2] Use go 1.21 (#65) --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 95ad13d..2b9ac05 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/Fantom-foundation/Substate -go 1.22 +go 1.21 require ( github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 From 6d51459ef3585e19210860cce309c8363f568ed8 Mon Sep 17 00:00:00 2001 From: Petr Hanzl <84449820+petr-hanzl@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:11:10 +0700 Subject: [PATCH 2/2] Github actions (#36) Add github actions which performs - format checking - import checking - unit tests --------- Co-authored-by: wsodsong --- .github/pull_request_template.md | 16 ++++++++++++++++ .github/workflows/CI_UBUNTU.yaml | 22 ++++++++++++++++++++++ .github/workflows/Documentation.yaml | 21 +++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/CI_UBUNTU.yaml create mode 100644 .github/workflows/Documentation.yaml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..93e9c4b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,16 @@ +## Description + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +## Type of change + +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Refactoring (changes that do NOT affect functionality) +- [ ] Adds or updates testing +- [ ] This change requires a documentation update diff --git a/.github/workflows/CI_UBUNTU.yaml b/.github/workflows/CI_UBUNTU.yaml new file mode 100644 index 0000000..a556c0c --- /dev/null +++ b/.github/workflows/CI_UBUNTU.yaml @@ -0,0 +1,22 @@ +name: CI + +on: + pull_request: + branches: [ "main", "develop" ] + +jobs: + + build: + runs-on: self-hosted + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check import formatting + run: diff -u <(echo -n) <(find . \( -path "./carmen" -o -path "./tosca" \) -prune -o -name '*.go' -exec goimports -l {} \;) + + - name: Check code formatting + run: diff -u <(echo -n) <(find . \( -path "./carmen" -o -path "./tosca" \) -prune -o -name '*.go' -exec gofmt -d -s {} \;) + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/Documentation.yaml b/.github/workflows/Documentation.yaml new file mode 100644 index 0000000..93c898b --- /dev/null +++ b/.github/workflows/Documentation.yaml @@ -0,0 +1,21 @@ +name: Documentation + +on: + pull_request: + branches: + - main + types: + - closed + +jobs: + docs_update: + if: ${{ github.event.pull_request.merged }} + runs-on: self-hosted + steps: + - name: Upload Documentation to Wiki + uses: SwiftDocOrg/github-wiki-publish-action@v1 + with: + path: "docs" + env: + GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} +