Skip to content

Commit

Permalink
Merge branch 'master' into test_voting_period
Browse files Browse the repository at this point in the history
Signed-off-by: yihuang <[email protected]>
  • Loading branch information
yihuang authored Aug 15, 2024
2 parents 4f6f35a + f7224d0 commit b20f8b8
Show file tree
Hide file tree
Showing 224 changed files with 26,839 additions and 21,610 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- uses: actions/checkout@v3
with:
submodules: true
- name: install govulncheck
run: go install -v golang.org/x/vuln/cmd/govulncheck@v0.0.0-20221208170415-d970d6cd0f6e
run: go install -v golang.org/x/vuln/cmd/govulncheck@v1.0.4
- name: govuln sec scan
run: govulncheck ./...
57 changes: 29 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,41 @@ jobs:
- name: Get Comment PR informations
id: pr_data
if: github.event_name == 'issue_comment'
env:
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_DATE: ${{ github.event.comment.created_at }}
run: |
echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT
comment_hash=`echo ${{ github.event.comment.body }} | cut -d' ' -f2` # get commit hash if any
PR_PUSHED_AT="${{ fromJson(steps.request.outputs.data).pushed_at }}"
comment_hash=`echo "$COMMENT_BODY" | cut -d' ' -f2` # get commit hash if any
if [[ "${comment_hash}" == "/runsim" ]]; then
# use default head ref
echo "ref=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT
# use default head ref, if the PR hasn't changed since the comment
if [[ $(date -d "$PR_PUSHED_AT" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then
echo "The PR has changed since the comment, and is therefore not safe to use. Exiting."
exit 1
fi
echo "ref=${{ fromJson(steps.request.outputs.data).head.sha }}" >> $GITHUB_OUTPUT
else
# use comment provided ref
echo "ref=${comment_hash}" >> $GITHUB_OUTPUT
fi
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ steps.pr_data.outputs.repo_name }}
ref: ${{ steps.pr_data.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
with:
submodules: true
if: github.event_name == 'push' || github.event_name == 'pull_request'
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand All @@ -113,7 +119,7 @@ jobs:
run: make test
if: "steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'issue_comment'"
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
Expand All @@ -135,18 +141,19 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v23
with:
# pin to nix-2.13 to workaround compability issue of 2.14,
# see: https://github.com/cachix/install-nix-action/issues/161
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand Down Expand Up @@ -175,7 +182,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- name: install runsim
run: |
export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
Expand All @@ -200,22 +207,21 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand Down Expand Up @@ -247,22 +253,21 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand Down Expand Up @@ -294,22 +299,21 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand Down Expand Up @@ -405,17 +409,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
go.mod
go.sum
- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v23
if: steps.changed-files.outputs.any_changed == 'true'
with:
# pin to nix-2.13 to workaround compability issue of 2.14,
# see: https://github.com/cachix/install-nix-action/issues/161
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: update gomod2nix
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- name: Normal check out code
uses: actions/checkout@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- uses: actions/checkout@v3
with:
submodules: true
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand All @@ -31,7 +31,7 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'

# - name: Upload coverage report
# uses: codecov/codecov-action@v3
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.22
- uses: actions/checkout@v3
with:
submodules: true
- id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51
version: v1.55
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: steps.changed-files.outputs.any_changed == 'true'
Loading

0 comments on commit b20f8b8

Please sign in to comment.