-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimal set of working Gitea workflows. (#138)
As a first step on https://git.vdb.to/cerc-io/laconicd/issues/116, provide a minimal set of actions which are either already working or expected to work on Gitea. Reviewed-on: https://git.vdb.to/cerc-io/laconicd/pulls/138 Co-authored-by: Thomas E Lackey <[email protected]> Co-committed-by: Thomas E Lackey <[email protected]>
- Loading branch information
Showing
10 changed files
with
269 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- run: | | ||
make build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Deploy Contract | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- name: Test contract | ||
run: | | ||
make contract-tools | ||
# This seems to be an empty placeholder. | ||
make test-contract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Publish on release | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
build: | ||
name: Run docker build and publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run docker build | ||
run: docker build -t cerc-io/laconicd -f Dockerfile . | ||
- name: Get the version | ||
id: vars | ||
run: | | ||
echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) | ||
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/}) | ||
- name: Tag docker image | ||
run: docker tag cerc-io/laconicd git.vdb.to/cerc-io/laconicd/laconicd:${{steps.vars.outputs.sha}} | ||
- name: Tag docker image | ||
run: docker tag git.vdb.to/cerc-io/laconicd/laconicd:${{steps.vars.outputs.sha}} git.vdb.to/cerc-io/laconicd/laconicd:${{steps.vars.outputs.tag}} | ||
- name: Docker Login | ||
run: echo ${{ secrets.CICD_PUBLISH_TOKEN }} | docker login https://git.vdb.to -u cerccicd --password-stdin | ||
- name: Docker Push | ||
run: docker push git.vdb.to/cerc-io/laconicd/laconicd:${{steps.vars.outputs.sha}} | ||
- name: Docker Push TAGGED | ||
run: docker push git.vdb.to/cerc-io/laconicd/laconicd:${{steps.vars.outputs.tag}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- name: release dry run | ||
run: make release-dry-run | ||
- name: setup release environment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CICD_PUBLISH_TOKEN }} | ||
run: |- | ||
echo 'GITHUB_TOKEN=${{secrets.CICD_PUBLISH_TOKEN}}' > .release-env | ||
- name: release publish | ||
run: make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Lint | ||
# Lint runs golangci-lint over the entire ethermint repository This workflow is | ||
# run on every pull request and push to main The `golangci` will pass without | ||
# running if no *.{go, mod, sum} files have been changed. | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
golangci: | ||
name: Run golangci-lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
# Required: setup-go, for all versions v3.0.0+ of golangci-lint | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- uses: golangci/[email protected] | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: latest | ||
args: --timeout 10m | ||
github-token: ${{ secrets.github_token }} | ||
|
||
python-lint: | ||
# For compatibility with Gitea | ||
env: | ||
USER: root | ||
name: Run flake8 on python integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cachix/install-nix-action@v20 | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: ethermint | ||
- run: | | ||
nix-shell -I nixpkgs=./nix -p test-env --run "make lint-py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Protobuf | ||
# Protobuf runs buf (https://buf.build/) lint and check-breakage | ||
# This workflow is only run when a .proto file has been changed | ||
on: | ||
pull_request: | ||
paths: | ||
- "proto/**" | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: bufbuild/[email protected] | ||
- uses: bufbuild/buf-lint-action@v1 | ||
with: | ||
input: "proto" | ||
|
||
break-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: bufbuild/[email protected] | ||
- uses: bufbuild/buf-breaking-action@v1 | ||
with: | ||
input: "proto" | ||
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- release/** | ||
|
||
jobs: | ||
test-unit: | ||
# This test case doesn't work in CI, run as root. | ||
env: | ||
SKIP_UNIT_TESTS: TestInitConfigNonNotExistError | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- name: Test | ||
run: | | ||
make test-unit | ||
test-importer: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- name: test-importer | ||
run: | | ||
make test-import | ||
test-rpc: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- name: Test rpc endpoint | ||
run: | | ||
make test-rpc | ||
sdk_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout laconic-sdk | ||
uses: actions/checkout@v3 | ||
with: | ||
path: "./laconic-sdk/" | ||
repository: cerc-io/laconic-sdk | ||
fetch-depth: 0 | ||
ref: main | ||
- name: Environment | ||
run: ls -tlh && env | ||
|
||
- name: Build laconicd container | ||
working-directory: tests/sdk_tests | ||
run: ./build-laconicd-container.sh | ||
|
||
- name: Build laconic-sdk container | ||
working-directory: laconic-sdk | ||
run: ./scripts/build-sdk-test-container.sh | ||
|
||
- name: Start containers | ||
working-directory: tests/sdk_tests | ||
run: docker compose up -d | ||
|
||
- name: Run tests | ||
working-directory: tests/sdk_tests | ||
run: ./run-tests.sh | ||
|
||
- name: Start containers (auctions enabled) | ||
working-directory: tests/sdk_tests | ||
env: | ||
TEST_AUCTION_ENABLED: true | ||
run: docker compose up -d | ||
|
||
- name: Run auction tests | ||
working-directory: tests/sdk_tests | ||
run: ./run-tests.sh test:auctions | ||
|
||
- name: Start containers (expiry enabled) | ||
working-directory: tests/sdk_tests | ||
env: | ||
TEST_REGISTRY_EXPIRY: true | ||
run: docker compose up -d | ||
|
||
- name: Run nameservice expiry tests | ||
working-directory: tests/sdk_tests | ||
run: ./run-tests.sh test:nameservice-expiry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters