Skip to content

Commit

Permalink
all: prepare for renaming master branch to main (#910)
Browse files Browse the repository at this point in the history
The actual change will happen "by hand" after this PR is merged. These
are just preparatory steps which might well cause the build of the
resulting PR squash and merge to fail, but subsequent builds will
succeed.
  • Loading branch information
myitcv authored Jul 27, 2020
1 parent 02d18f2 commit 8e423df
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-based_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
schedule:
- cron: '0 9 * * *'

name: Vim Master Test
name: Vim Main Test
jobs:
test:
strategy:
Expand All @@ -21,5 +21,5 @@ jobs:
with:
stable: 'false'
go-version: ${{ matrix.go-version }}
- name: Run master tests
run: ./_scripts/testVimMaster.sh
- name: Run main tests
run: ./_scripts/testVimMain.sh
4 changes: 2 additions & 2 deletions _scripts/dockerRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ source "${BASH_SOURCE%/*}/common.bash"
# This ensures that GitHub Actions properly runs the after_failure script
trap 'set +ev' EXIT

# We run race builds/tests on master branch. We also define that the RACE_BUILD
# We run race builds/tests on main branch. We also define that the RACE_BUILD
# environment variable be a comma-separated list of PR numbers (just the
# number, no '#'), and if the CI build in question is a PR build whose number
# is present in RACE_BUILD we also run race builds/tests.
runRace=false
if [[ "${CI:-}" == "true" ]]
then
if [[ "${GITHUB_REF:-}" == "refs/heads/master" ]]
if [[ "${GITHUB_REF:-}" == "refs/heads/main" ]]
then
runRace=true
elif [[ "${GITHUB_EVENT_NAME:-}" == "pull_request" ]]
Expand Down
12 changes: 6 additions & 6 deletions _scripts/tagDockerLatest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
source "${BASH_SOURCE%/*}/common.bash"

# Update the :latest tag for govim images. By default only runs on CI whilst
# building against the master branch. This isn't totally foolproof, but good
# building against the main branch. This isn't totally foolproof, but good
# enough for what we need
#
# Usage:
#
# _scripts/tagDockerLatest.sh [-f]
#
# The -f flag forces the update of latest, even when we aren't running on CI
# against the master branch
# against the main branch

# Only run for the build matrix entry that corresponds to
# the tag we are going to create
Expand All @@ -24,14 +24,14 @@ fi
# If we are not on CI, then only run if -f is supplied
if [[ "${CI:-}" != "true" ]] && [[ "${1:-}" != "-f" ]]
then
echo "Cowardly refusing to tag :latest; not on CI building master branch, and no -f supplied"
echo "Cowardly refusing to tag :latest; not on CI building main branch, and no -f supplied"
exit 1
fi

# If we are on CI, only tag if we are on the master branch
if [[ "${CI:-}" == "true" ]] && [[ "${GITHUB_REF:-}" != "refs/heads/master" ]]
# If we are on CI, only tag if we are on the main branch
if [[ "${CI:-}" == "true" ]] && [[ "${GITHUB_REF:-}" != "refs/heads/main" ]]
then
echo "Skipping tagging of :latest docker image; we are not building master branch"
echo "Skipping tagging of :latest docker image; we are not building main branch"
exit 0
fi

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion github/actions/setupvim/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Setup Vim in your workflow'
inputs:
version:
description: >
Version of Vim to install. Valid values are git refs (e.g. 'master', a branch name or commit hash)
Version of Vim to install. Valid values are git refs (e.g. 'main', a branch name or commit hash)
or version tags (e.g. 'v8.2.0126')
required: false
default: 'master'
Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/genconfig/genconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func writeMaxVersionsScripts() {
}
vs.ValidFlavors = strings.Join(flavStrings, " ")
writeFileFromTmpl(filepath.Join("_scripts", "gen_maxVersions_genconfig.bash"), maxVersions, vs)
writeFileFromTmpl(".github/workflows/vim_master.yml", vimMasterYaml, vs)
writeFileFromTmpl(".github/workflows/vim_main.yml", vimMainYaml, vs)
}

// vimSemverCompare compares two Vim versions. Vim incorrectly puts leading
Expand Down Expand Up @@ -280,7 +280,7 @@ const dockerWorkflowYaml = `# Code generated by genconfig. DO NOT EDIT.
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**'
Expand Down Expand Up @@ -339,12 +339,12 @@ jobs:
name: ${{ matrix.os }}_${{ matrix.go_version }}_${{ matrix.vim_flavor }}_${{ matrix.vim_version }}
`

const vimMasterYaml = `# Code generated by genconfig. DO NOT EDIT.
const vimMainYaml = `# Code generated by genconfig. DO NOT EDIT.
on:
schedule:
- cron: '0 9 * * *'
name: Vim Master Test
name: Vim Main Test
jobs:
test:
strategy:
Expand All @@ -362,8 +362,8 @@ jobs:
with:
stable: 'false'
go-version: ${{ matrix.go-version }}
- name: Run master tests
run: ./_scripts/testVimMaster.sh
- name: Run main tests
run: ./_scripts/testVimMain.sh
`

const maxVersions = `# Code generated by genconfig. DO NOT EDIT.
Expand Down

0 comments on commit 8e423df

Please sign in to comment.