Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(github): adds go actions #25

Closed
wants to merge 9 commits into from
Closed

ci(github): adds go actions #25

wants to merge 9 commits into from

Conversation

jmozah
Copy link
Contributor

@jmozah jmozah commented Jan 4, 2024

Add go actions like build, format, lint and gosec to the workflows.

task: none

@jmozah jmozah requested a review from corverroos January 4, 2024 21:55
@jmozah jmozah self-assigned this Jan 4, 2024
.github/workflows/go.yml Outdated Show resolved Hide resolved
.github/workflows/go.yml Outdated Show resolved Hide resolved
.github/workflows/go.yml Outdated Show resolved Hide resolved
.github/workflows/go.yml Outdated Show resolved Hide resolved
.github/workflows/go.yml Outdated Show resolved Hide resolved
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure testing twice is required, it doubles the time it take. Why do we need to test in multiple architectures?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we not see if it runs in atleast 2 of the most important archs?

cache: true
go-version-file: go.mod
- name: Build
run: make build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make file not in PR

runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use latest version of these actions, ie:

      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5

Comment on lines 23 to 25
go get -v -t -d ./...
- name: Build
run: go build -v ./...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of building all binaries? It doesn't seem like the build artefacts are cached? golangci-lint already detects is code doesn't compile.

with:
skip-cache: false
version: v1.55.2
args: --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest:

          # Verbose with color. Just fail, don't fix issues. Use both annotations and normal output.
          args: -v --color=always --fix=false --out-format=colored-line-number,github-actions

No need to specify --config=.golangci.yml as that is the defailt

What is the purpose of NO_FUTURE?

@jmozah jmozah marked this pull request as draft January 5, 2024 07:17
Zahoor Mohamed and others added 7 commits January 5, 2024 20:16
This PR adds the github standard "Contributor Covenant Code of Conduct".

task: none
Adds a simple `Makefile` to the root that install the linter
(`pre-commit`) and does linting. To see available make commands, run
`make help`.

task: none
Adds two github actions:
 - `golangci-lint`: Runs the go linter so issues are added inline to PR.
 - `pre-commit`: Runs pre-commit hooks (excluding golangci-lint)

task: none
Adds the basic xtypes.

Note these are Golang optimised types. They do not represent the
solidity types, nor how these types are serialised exactly, since
solidity is data sensitive and should remove all duplication. These
types are slightly denormalised, containing `XMsgID` which contain
`XStreamID` which is a slight duplication since `SourceChainID` can
usually be inferred from the context. This is included for convenience
and for explicitness.

task: https://app.asana.com/0/1206208509925075/1206208573439595
Implement basic app cmd pattern with re-useable code in `lib/cmd`.

task: none
Adds goreleaser config and building halo binary and docker images.
Also adds simple release action that pushes the latest docker image to
dockerhub.

task: none
@jmozah
Copy link
Contributor Author

jmozah commented Jan 5, 2024

A previous PR took care of lint which does most of the stuff.
So closing this PR in favour of that.

@jmozah jmozah closed this Jan 5, 2024
@Lazar955 Lazar955 deleted the jmozah/github-actions branch February 9, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants