Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/copy-workflow-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ description: Copy workflow steps specific to go
runs:
using: "composite"
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
# This should be the same Go version we use in the go-check workflow.
# go mod tidy, go vet, staticcheck and gofmt might behave differently depending on the version.
go-version: "1.18.x"
go-version: "1.19.x"
- name: bump go.mod go version if needed
uses: protocol/[email protected]
with:
working-directory: ${{ env.TARGET_REPO_DIR }}
run: |
# We want our modules to support two Go versions at a time.
# As of March 2022, Go 1.18 is the latest stable.
# As of August 2022, Go 1.19 is the latest stable.
# go.mod's Go version declares the language version being used.
# As such, it has to be the minimum of all Go versions supported.
# Bump this every six months, as new Go versions come out.
TARGET_VERSION=1.17
PREVIOUS_TARGET_VERSION=1.16
TARGET_VERSION=1.18
PREVIOUS_TARGET_VERSION=1.17

# Note that the "<" comparison doesn't understand semver,
# but it should be good enough for the foreseeable future.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
outputs:
status: ${{ steps.should-automerge.outputs.status }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if we should automerge
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-3rd-party.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
pull_request:
paths-ignore:
- 'configs/*.json'
Expand All @@ -11,7 +11,7 @@ jobs:
outputs:
targets: ${{ steps.set-matrix.outputs.targets }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- id: set-matrix
run: |
TARGETS=$(find . -type f -name "*.yml" | sed "s|^\./||" | grep -v workflow-templates/header.yml | jq -R -s -c 'split("\n")[:-1]')
Expand All @@ -25,6 +25,6 @@ jobs:
file: ${{ fromJson(needs.matrix.outputs.targets) }}
name: ${{ matrix.file }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run check
run: .github/workflows/check-3rd-party.sh ${{ matrix.file }}
2 changes: 1 addition & 1 deletion .github/workflows/check-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
check-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: check if config files are sorted alphabetically
run: |
for config in configs/*.json; do
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
check-yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: nwisbeta/validate-yaml-schema@c3734e647d2a3beb98b9132330067e900fdbd1a2 # v2.0.0
with:
yamlSchemasJson: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/copy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ jobs:
name: ${{ matrix.cfg.target }}
steps:
- name: Checkout ${{ matrix.cfg.target }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ${{ env.TARGET_REPO_DIR }}
repository: ${{ matrix.cfg.target }}
token: ${{ secrets.WEB3BOT_GITHUB_TOKEN }}
persist-credentials: true
submodules: recursive
- name: Checkout template repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ${{ env.TEMPLATE_REPO_DIR }}
ref: ${{ matrix.cfg.source_ref || github.ref }}
- name: determine GitHub default branch
working-directory: ${{ env.TARGET_REPO_DIR }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.WEB3BOT_GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_commit.id || github.sha }}
- name: Sync PRs in targets that need it
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: Dispatch
on:
push:
branches: [ master, testing ]
workflow_dispatch:

env:
# Number of repositories in a batch.
Expand All @@ -23,12 +24,13 @@ env:

jobs:
matrix:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/testing'
name: Batch targets
runs-on: ubuntu-latest
outputs:
batches: ${{ steps.set-matrix.outputs.batches }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- id: set-matrix
run: |
targets=()
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
GOMODDIFF: ""
RELEASE_BRANCH_NOTE: ""
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18.x"
go-version: "1.19.x"
- name: Determine version
if: hashFiles('version.json')
run: echo "VERSION=$(jq -r .version version.json)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
CREATETAG: "false"
DEFAULT_BRANCH: ""
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Determine version
run: echo "VERSION=$(jq -r .version version.json)" >> $GITHUB_ENV
- name: Determine branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Find stale repositories
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: find deleted / archived repositories
run: |
status=0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tagpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
env:
TAGNAME: ""
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: cat "$GITHUB_EVENT_PATH" | jq -M .
- name: extract tag name
run: |
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ This check will be run in repositories that set `gogenerate` to `true` in `.gith
Note that depending on the code generators used, it might be necessary to [install those first](#additional-setup-steps).
The generators must also be deterministic, to prevent CI from getting different results each time.

## Technical Preview

You can opt-in to receive early updates from the `next` branch in-between official Unified CI releases.

To do so you have to set `source_ref` property to `next` on your repository target object in the configuration file.
```json
{
"repositories": [
{
"target": "pl-strflt/example",
"source_ref": "next"
}
]
}
```

_Warning_: `next` branch updates are much more frequent than those from `master`.

## Technical Details

This repository currently defines two workflows for Go repositories:
Expand Down
12 changes: 0 additions & 12 deletions configs/go.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@
{
"target": "libp2p/go-doh-resolver"
},
{
"target": "libp2p/go-eventbus"
},
{
"target": "libp2p/go-flow-metrics"
},
Expand All @@ -360,9 +357,6 @@
{
"target": "libp2p/go-libp2p-consensus"
},
{
"target": "libp2p/go-libp2p-core"
},
{
"target": "libp2p/go-libp2p-daemon"
},
Expand All @@ -387,9 +381,6 @@
{
"target": "libp2p/go-libp2p-loggables"
},
{
"target": "libp2p/go-libp2p-peerstore"
},
{
"target": "libp2p/go-libp2p-pubsub-router"
},
Expand All @@ -405,9 +396,6 @@
{
"target": "libp2p/go-libp2p-relay-daemon"
},
{
"target": "libp2p/go-libp2p-resource-manager"
},
{
"target": "libp2p/go-libp2p-routing-helpers"
},
Expand Down
8 changes: 4 additions & 4 deletions templates/.github/workflows/go-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
env:
RUNGOGENERATE: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.18.x"
go-version: "1.19.x"
- name: Run repo-specific setup
uses: ./.github/actions/go-check-setup
if: hashFiles('./.github/actions/go-check-setup') != ''
Expand All @@ -24,7 +24,7 @@ jobs:
echo "RUNGOGENERATE=true" >> $GITHUB_ENV
fi
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@d7e217c1ff411395475b2971c0824e1e7cc1af98 # 2022.1 (v0.3.0)
run: go install honnef.co/go/tools/cmd/staticcheck@376210a89477dedbe6fdc4484b233998650d7b3c # 2022.1.3 (v0.3.3)
- name: Check that go.mod is tidy
uses: protocol/[email protected]
with:
Expand Down
12 changes: 6 additions & 6 deletions templates/.github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu", "windows", "macos" ]
go: [ "1.17.x", "1.18.x" ]
go: [ "1.18.x", "1.19.x" ]
env:
COVERAGES: ""
runs-on: ${{ format('{0}-latest', matrix.os) }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Go information
Expand All @@ -40,7 +40,7 @@ jobs:
# Use -coverpkg=./..., so that we include cross-package coverage.
# If package ./A imports ./B, and ./A's tests also cover ./B,
# this means ./B's coverage will be significantly higher than 0%.
run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./...
run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
- name: Run tests (32 bit)
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
uses: protocol/[email protected]
Expand All @@ -49,7 +49,7 @@ jobs:
with:
run: |
export "PATH=${{ env.PATH_386 }}:$PATH"
go test -v ./...
go test -v -shuffle=on ./...
- name: Run tests with race detector
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
uses: protocol/[email protected]
Expand All @@ -59,7 +59,7 @@ jobs:
shell: bash
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
- name: Upload coverage to Codecov
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
files: '${{ env.COVERAGES }}'
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}
18 changes: 9 additions & 9 deletions templates/.github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -29,7 +29,7 @@ jobs:
node: [16]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
Expand All @@ -43,7 +43,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -57,7 +57,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -71,7 +71,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -85,7 +85,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -99,7 +99,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -113,7 +113,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand All @@ -128,7 +128,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/$default-branch' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v2
Expand Down