bump: version 0.0.1 → 0.1.0 #28
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
name: Check source code | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
run-pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pre-commit binaries | |
run: | | |
pip install pre-commit | |
- name: Run pre-commit | |
run: | | |
make install-pre-commit | |
make pre-commit | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install commitizen | |
run: pip install commitizen | |
- name: Check the branch commits | |
run: | | |
cz check --rev-range origin/HEAD..HEAD | |
code-format: | |
name: Code format | |
strategy: | |
matrix: | |
go: ["1.23"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set git to use LF | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install abigen | |
run: make install-abigen | |
- name: Generate contract bindings | |
run: make generate | |
- name: Instal gofumpt | |
run: make install-gofumpt | |
- name: Check code format | |
run: | | |
if [[ ! -z $(make format) ]]; | |
then | |
echo "Code is not formatted. Please run 'make format' and commit changes" | |
exit 1 | |
fi | |
shell: bash | |
- name: Install staticcheck | |
run: make install-staticcheck | |
- name: Run staticcheck | |
run: make staticcheck | |
build: | |
name: Build | |
needs: code-format | |
strategy: | |
matrix: | |
go: ["1.23"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set git to use LF | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install abigen | |
run: make install-abigen | |
- name: Generate contract bindings | |
run: make generate | |
- name: Check go mod status | |
run: | | |
make gomod_tidy | |
if [[ ! -z $(git status -s | grep 'go.mod') ]] || [[ ! -z $(git status -s | grep 'go.sum') ]]; | |
then | |
echo "Changes on go.mod or go.sum files - state is not clean:" | |
git status -s | |
git diff "$GITHUB_SHA" | |
exit 1 | |
fi | |
shell: bash | |
- name: Check build | |
run: make build | |
test: | |
name: Run tests | |
needs: build | |
strategy: | |
matrix: | |
go: ["1.23"] | |
os: [ubuntu-latest] | |
codecov: [false] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install deps | |
run: make install-deps | |
- name: Run tests | |
if: matrix.codecov == false | |
run: make test | |
- name: Run codecov tests | |
if: matrix.codecov == true | |
run: make codecov-test | |
- name: Upload coverage to Codecov | |
if: matrix.codecov == true | |
uses: codecov/codecov-action@v2 | |
with: | |
fail_ci_if_error: true | |
files: ./coverage.out | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} |