diff --git a/.github/actions/copy-workflow-go/action.yml b/.github/actions/copy-workflow-go/action.yml index f8a684f5..4356430a 100644 --- a/.github/actions/copy-workflow-go/action.yml +++ b/.github/actions/copy-workflow-go/action.yml @@ -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/multiple-go-modules@v1.2 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. diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 1a5cd12d..c24662ca 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -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 diff --git a/.github/workflows/check-3rd-party.yml b/.github/workflows/check-3rd-party.yml index 339793df..36203b6a 100644 --- a/.github/workflows/check-3rd-party.yml +++ b/.github/workflows/check-3rd-party.yml @@ -1,4 +1,4 @@ -on: +on: pull_request: paths-ignore: - 'configs/*.json' @@ -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]') @@ -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 }} diff --git a/.github/workflows/check-config.yml b/.github/workflows/check-config.yml index 1ee8aab6..db30405f 100644 --- a/.github/workflows/check-config.yml +++ b/.github/workflows/check-config.yml @@ -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 diff --git a/.github/workflows/check-yaml.yml b/.github/workflows/check-yaml.yml index 5442b6ed..890a8e3d 100644 --- a/.github/workflows/check-yaml.yml +++ b/.github/workflows/check-yaml.yml @@ -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: | diff --git a/.github/workflows/copy-workflow.yml b/.github/workflows/copy-workflow.yml index 235beed0..893823a6 100644 --- a/.github/workflows/copy-workflow.yml +++ b/.github/workflows/copy-workflow.yml @@ -28,7 +28,7 @@ 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 }} @@ -36,9 +36,10 @@ jobs: 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: | diff --git a/.github/workflows/create-prs.yml b/.github/workflows/create-prs.yml index 688100d7..01c96d15 100644 --- a/.github/workflows/create-prs.yml +++ b/.github/workflows/create-prs.yml @@ -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 diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index 0c2d579b..f546cb34 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -7,6 +7,7 @@ name: Dispatch on: push: branches: [ master, testing ] + workflow_dispatch: env: # Number of repositories in a batch. @@ -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=() diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 41249482..5b2e63bc 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -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 diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index 9a981c22..7c27f737 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -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 diff --git a/.github/workflows/stale-repos.yml b/.github/workflows/stale-repos.yml index c70a42df..c7889423 100644 --- a/.github/workflows/stale-repos.yml +++ b/.github/workflows/stale-repos.yml @@ -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 diff --git a/.github/workflows/tagpush.yml b/.github/workflows/tagpush.yml index 0375f35d..f295aacf 100644 --- a/.github/workflows/tagpush.yml +++ b/.github/workflows/tagpush.yml @@ -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: | diff --git a/README.md b/README.md index 37b82d46..22198a06 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/configs/go.json b/configs/go.json index b4654ed0..4b6b75f4 100644 --- a/configs/go.json +++ b/configs/go.json @@ -336,9 +336,6 @@ { "target": "libp2p/go-doh-resolver" }, - { - "target": "libp2p/go-eventbus" - }, { "target": "libp2p/go-flow-metrics" }, @@ -360,9 +357,6 @@ { "target": "libp2p/go-libp2p-consensus" }, - { - "target": "libp2p/go-libp2p-core" - }, { "target": "libp2p/go-libp2p-daemon" }, @@ -387,9 +381,6 @@ { "target": "libp2p/go-libp2p-loggables" }, - { - "target": "libp2p/go-libp2p-peerstore" - }, { "target": "libp2p/go-libp2p-pubsub-router" }, @@ -405,9 +396,6 @@ { "target": "libp2p/go-libp2p-relay-daemon" }, - { - "target": "libp2p/go-libp2p-resource-manager" - }, { "target": "libp2p/go-libp2p-routing-helpers" }, diff --git a/templates/.github/workflows/go-check.yml b/templates/.github/workflows/go-check.yml index 3b7cc2c8..22d23a45 100644 --- a/templates/.github/workflows/go-check.yml +++ b/templates/.github/workflows/go-check.yml @@ -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') != '' @@ -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/multiple-go-modules@v1.2 with: diff --git a/templates/.github/workflows/go-test.yml b/templates/.github/workflows/go-test.yml index b321ae83..10307176 100644 --- a/templates/.github/workflows/go-test.yml +++ b/templates/.github/workflows/go-test.yml @@ -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 @@ -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/multiple-go-modules@v1.2 @@ -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/multiple-go-modules@v1.2 @@ -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 }} diff --git a/templates/.github/workflows/js-test-and-release.yml b/templates/.github/workflows/js-test-and-release.yml index 05ac5920..44d92db3 100644 --- a/templates/.github/workflows/js-test-and-release.yml +++ b/templates/.github/workflows/js-test-and-release.yml @@ -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/* @@ -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 }} @@ -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/* @@ -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/* @@ -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/* @@ -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/* @@ -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/* @@ -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/* @@ -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