Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Web3 bot/sync (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
web3-bot authored Apr 3, 2023
1 parent 400dcc3 commit 7d611b1
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
name: Automerge
on: [ pull_request ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
automerge:
uses: protocol/.github/.github/workflows/automerge.yml@master
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

on: [push, pull_request]
on:
pull_request:
push:
branches: ["master"]
name: Go Checks

permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true

jobs:
unit:
Expand All @@ -17,9 +21,12 @@ jobs:
submodules: recursive
- id: config
uses: protocol/.github/.github/actions/read-config@master
- id: go-mod
# TODO: change ref to next before merging
uses: protocol/.github/.github/actions/read-go-mod@no-go
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: ${{ fromJSON(steps.go-mod.outputs.json).Go }}.x
- name: Run repo-specific setup
uses: ./.github/actions/go-check-setup
if: hashFiles('./.github/actions/go-check-setup') != ''
Expand Down
48 changes: 35 additions & 13 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

on: [push, pull_request]
on:
pull_request:
push:
branches: ["master"]
name: Go Test

permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true

jobs:
unit:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu", "windows", "macos" ]
go: ["1.19.x","1.20.x"]
go: [ "this", "next" ]
env:
GOTESTFLAGS: -shuffle=on -cover -coverprofile=module-coverage.txt -coverpkg=./...
GO386FLAGS: -shuffle=on
GORACEFLAGS: -shuffle=on
runs-on: ${{ fromJSON(vars[format('UCI_GO_TEST_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- name: Use msys2 on windows
if: matrix.os == 'windows'
shell: bash
# The executable for msys2 is also called bash.cmd
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
# If we prepend its location to the PATH
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
submodules: recursive
- id: config
uses: protocol/.github/.github/actions/read-config@master
- id: go-mod
# TODO: change ref to next before merging
uses: protocol/.github/.github/actions/read-go-mod@no-go
- id: go
env:
MATRIX_GO: ${{ matrix.go }}
GO_MOD_VERSION: ${{ fromJSON(steps.go-mod.outputs.json).Go }}
run: |
if [[ "$MATRIX_GO" == "this" ]]; then
echo "version=$GO_MOD_VERSION.x" >> $GITHUB_OUTPUT
elif [[ "$MATRIX_GO" == "next" ]]; then
MAJOR="${GO_MOD_VERSION%.[0-9]*}"
MINOR="${GO_MOD_VERSION#[0-9]*.}"
echo "version=$MAJOR.$(($MINOR+1)).x" >> $GITHUB_OUTPUT
else
echo "version=$MATRIX_GO" >> $GITHUB_OUTPUT
fi
shell: bash
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
go-version: ${{ steps.go.outputs.version }}
- name: Go information
run: |
go version
go env
- name: Use msys2 on windows
if: matrix.os == 'windows'
shell: bash
# The executable for msys2 is also called bash.cmd
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
# If we prepend its location to the PATH
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
- name: Run repo-specific setup
uses: ./.github/actions/go-test-setup
if: hashFiles('./.github/actions/go-test-setup') != ''
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ on:
pull_request_target:
paths: [ 'version.json' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release-check:
uses: protocol/.github/.github/workflows/release-check.yml@master
with:
go-version: 1.20.x
4 changes: 4 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
push:
paths: [ 'version.json' ]

concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true

jobs:
releaser:
uses: protocol/.github/.github/workflows/releaser.yml@master
4 changes: 4 additions & 0 deletions .github/workflows/tagpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
tags:
- v*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
releaser:
uses: protocol/.github/.github/workflows/tagpush.yml@master

0 comments on commit 7d611b1

Please sign in to comment.