From b93e134b5b589d23cb91249f515f0e18d16d2590 Mon Sep 17 00:00:00 2001 From: Aleksey Kravchenko Date: Fri, 10 Jan 2025 19:09:47 +0300 Subject: [PATCH] [#1] Add forgejo actions Signed-off-by: Aleksey Kravchenko --- .forgejo/ISSUE_TEMPLATE/bug_report.md | 45 ++++++++++++++++++ .forgejo/ISSUE_TEMPLATE/config.yml | 1 + .forgejo/workflows/builds.yaml | 24 ++++++++++ .forgejo/workflows/dco.yml | 20 ++++++++ .forgejo/workflows/tests.yml | 67 +++++++++++++++++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 .forgejo/ISSUE_TEMPLATE/bug_report.md create mode 100644 .forgejo/ISSUE_TEMPLATE/config.yml create mode 100644 .forgejo/workflows/builds.yaml create mode 100644 .forgejo/workflows/dco.yml create mode 100644 .forgejo/workflows/tests.yml diff --git a/.forgejo/ISSUE_TEMPLATE/bug_report.md b/.forgejo/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..7e778d2fe --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,45 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: community, triage, bug +assignees: '' + +--- + + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + + + + +## Steps to Reproduce (for bugs) + + + +1. + +## Context + + + +## Regression + + + +## Your Environment + +* Version used: +* Server setup and configuration: +* Operating System and version (`uname -a`): diff --git a/.forgejo/ISSUE_TEMPLATE/config.yml b/.forgejo/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..3ba13e0ce --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.forgejo/workflows/builds.yaml b/.forgejo/workflows/builds.yaml new file mode 100644 index 000000000..d588a7fa6 --- /dev/null +++ b/.forgejo/workflows/builds.yaml @@ -0,0 +1,24 @@ +on: + pull_request: + push: + branches: + - tcl/master + +jobs: + builds: + name: Builds + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.22', '1.23' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Build binary + run: make \ No newline at end of file diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml new file mode 100644 index 000000000..4acd63341 --- /dev/null +++ b/.forgejo/workflows/dco.yml @@ -0,0 +1,20 @@ +on: [pull_request] + +jobs: + dco: + name: DCO + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.23' + + - name: Run commit format checker + uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3 + with: + from: 'origin/${{ github.event.pull_request.base.ref }}' diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml new file mode 100644 index 000000000..496df944c --- /dev/null +++ b/.forgejo/workflows/tests.yml @@ -0,0 +1,67 @@ +on: + pull_request: + push: + branches: + - tcl/master + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.23' + cache: true + + - name: Install linters + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + + - name: Run linters + run: make check + test: + name: Test + runs-on: oci-runner + strategy: + matrix: + go_versions: [ '1.23' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Tests for the FrostFS backend + env: + RESTIC_TEST_FUSE: false + AIO_IMAGE: truecloudlab/frostfs-aio + AIO_VERSION: 1.7.0-nightly.4 + RCLONE_CONFIG: /config/rclone.conf + + # run only tests related to FrostFS backend + run: |- + podman-service.sh + podman info + + mkdir /config + printf "[TestFrostFS]\ntype = frostfs\nendpoint = localhost:8080\nwallet = /config/wallet.json\nplacement_policy = REP 1\nrequest_timeout = 20s\nconnection_timeout = 21s" > /config/rclone.conf + + echo "Run frostfs aio container" + docker run -d --net=host --name aio $AIO_IMAGE:$AIO_VERSION --restart always -p 8080:8080 + + echo "Wait for frostfs to start" + until docker exec aio curl --fail http://localhost:8083 > /dev/null 2>&1; do sleep 0.2; done; + + echo "Issue creds" + docker exec aio /usr/bin/issue-creds.sh native + echo "Copy wallet" + docker cp aio:/config/user-wallet.json /config/wallet.json + + echo "Start tests" + go test -v github.com/rclone/rclone/backend/frostfs \ No newline at end of file