mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-16 17:02:36 +00:00
chore(ci): refactor build (#29)
* chore: simplify workflows * chore: only build on master and renovate breanches * chore: rename jobs * chore: cancel previous builds * chore: testing * chore: update config * chore: add tests * chore: update renovate * chore: simplify entrypoint * chore: pass to default entrypoint * chore: include forks * fix: wrong home * chore: update config * fix: set renovate token in command rather than exporting Co-authored-by: Jeroen de Bruijn <vidavidorra+jdbruijn@gmail.com>
This commit is contained in:
parent
d11b5f6a7e
commit
b95ce7668b
7 changed files with 120 additions and 45 deletions
29
.github/config.js
vendored
Normal file
29
.github/config.js
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
module.exports = {
|
||||||
|
branchPrefix: 'test-renovate/',
|
||||||
|
dryRun: true,
|
||||||
|
gitAuthor: 'Renovate Bot <bot@renovateapp.com>',
|
||||||
|
logLevel: 'debug',
|
||||||
|
onboarding: false,
|
||||||
|
platform: 'github',
|
||||||
|
includeForks: true,
|
||||||
|
repositories: [
|
||||||
|
'renovatebot/github-action',
|
||||||
|
'renovate-tests/cocoapods1',
|
||||||
|
'renovate-tests/gomod1',
|
||||||
|
],
|
||||||
|
packageRules: [
|
||||||
|
{
|
||||||
|
description: 'lockFileMaintenance',
|
||||||
|
updateTypes: [
|
||||||
|
'pin',
|
||||||
|
'digest',
|
||||||
|
'patch',
|
||||||
|
'minor',
|
||||||
|
'major',
|
||||||
|
'lockFileMaintenance',
|
||||||
|
],
|
||||||
|
masterIssueApproval: false,
|
||||||
|
stabilityDays: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
16
.github/renovate.json
vendored
16
.github/renovate.json
vendored
|
|
@ -1,12 +1,24 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:base",
|
"config:base",
|
||||||
|
":rebaseStalePrs",
|
||||||
":pinDependencies",
|
":pinDependencies",
|
||||||
|
":masterIssue",
|
||||||
":timezone(Europe/Amsterdam)",
|
":timezone(Europe/Amsterdam)",
|
||||||
":assignee(vidavidorra)"
|
":assignee(vidavidorra)",
|
||||||
|
"docker:enableMajor"
|
||||||
],
|
],
|
||||||
"prCreation": "not-pending",
|
"prCreation": "not-pending",
|
||||||
"schedule": ["before 6am"],
|
"schedule": ["before 6am"],
|
||||||
|
"lockFileMaintenance": {
|
||||||
|
"enabled": true,
|
||||||
|
"schedule": ["at any time"],
|
||||||
|
"masterIssueApproval": true
|
||||||
|
},
|
||||||
|
"major": {
|
||||||
|
"stabilityDays": 3,
|
||||||
|
"masterIssueApproval": true
|
||||||
|
},
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"languages": ["docker"],
|
"languages": ["docker"],
|
||||||
|
|
@ -17,6 +29,7 @@
|
||||||
"description": "Automerge devDependencies updates",
|
"description": "Automerge devDependencies updates",
|
||||||
"depTypeList": ["devDependencies"],
|
"depTypeList": ["devDependencies"],
|
||||||
"updateTypes": ["pin", "digest", "patch", "minor"],
|
"updateTypes": ["pin", "digest", "patch", "minor"],
|
||||||
|
"schedule": ["at any time"],
|
||||||
"automerge": true,
|
"automerge": true,
|
||||||
"automergeType": "branch"
|
"automergeType": "branch"
|
||||||
},
|
},
|
||||||
|
|
@ -24,6 +37,7 @@
|
||||||
"description": "Automerge renovate minor and patch updates",
|
"description": "Automerge renovate minor and patch updates",
|
||||||
"packageNames": ["renovate/renovate"],
|
"packageNames": ["renovate/renovate"],
|
||||||
"updateTypes": ["minor", "patch"],
|
"updateTypes": ["minor", "patch"],
|
||||||
|
"schedule": ["at any time"],
|
||||||
"automerge": true,
|
"automerge": true,
|
||||||
"automergeType": "branch"
|
"automergeType": "branch"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
68
.github/workflows/build.yml
vendored
Normal file
68
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- 'renovate/**'
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cleanup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: github-cleanup
|
||||||
|
uses: renovatebot/internal-tools@v0
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
command: github-cleanup
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
commitlint:
|
||||||
|
needs: [cleanup]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.1.0
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Lint commit messages
|
||||||
|
uses: wagoid/commitlint-github-action@v1.6.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
lint:
|
||||||
|
needs: [cleanup]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.1.0
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v1.4.1
|
||||||
|
with:
|
||||||
|
node-version: '12.x'
|
||||||
|
- name: Install project
|
||||||
|
run: npm ci
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
e2e:
|
||||||
|
needs: [cleanup]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.1.0
|
||||||
|
- name: Renovate test
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
configurationFile: .github/config.js
|
||||||
|
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: [lint, commitlint, e2e]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo 'Dummy'
|
||||||
18
.github/workflows/lint-commit-messages.yml
vendored
18
.github/workflows/lint-commit-messages.yml
vendored
|
|
@ -1,18 +0,0 @@
|
||||||
name: Lint commit messages
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
jobs:
|
|
||||||
commitlint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2.1.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Lint commit messages
|
|
||||||
uses: wagoid/commitlint-github-action@v1.6.0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
20
.github/workflows/lint.yml
vendored
20
.github/workflows/lint.yml
vendored
|
|
@ -1,20 +0,0 @@
|
||||||
name: Lint
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2.1.0
|
|
||||||
- name: Setup node
|
|
||||||
uses: actions/setup-node@v1.4.1
|
|
||||||
with:
|
|
||||||
node-version: '12.x'
|
|
||||||
- name: Install project
|
|
||||||
run: npm ci
|
|
||||||
- name: Lint
|
|
||||||
run: npm run lint
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM renovate/renovate:19.219.11
|
FROM renovate/renovate:19.221.0
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/entrypoint.sh
|
COPY entrypoint.sh /usr/entrypoint.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@
|
||||||
#
|
#
|
||||||
# Entrypoint for Docker.
|
# Entrypoint for Docker.
|
||||||
|
|
||||||
readonly CONFIGURATION_FILE="${1}"
|
export RENOVATE_CONFIG_FILE="${GITHUB_WORKSPACE}/${1}"
|
||||||
readonly TOKEN="${2}"
|
readonly _RENOVATE_TOKEN="${2}"
|
||||||
|
|
||||||
export RENOVATE_CONFIG_FILE="${GITHUB_WORKSPACE}/${CONFIGURATION_FILE}"
|
# We are running as ubuntu, so no write access to /github/home
|
||||||
|
export HOME=/home/ubuntu
|
||||||
|
|
||||||
if [[ ! -f "${RENOVATE_CONFIG_FILE}" ]]; then
|
if [[ ! -f "${RENOVATE_CONFIG_FILE}" ]]; then
|
||||||
echo "ERROR: Couldn't find file ${RENOVATE_CONFIG_FILE}" 1>&2
|
echo "ERROR: Couldn't find file ${RENOVATE_CONFIG_FILE}" 1>&2
|
||||||
|
|
@ -16,5 +17,6 @@ fi
|
||||||
#
|
#
|
||||||
# Mimic the original ENTRYPOINT of the renovate/renovate Docker container. See
|
# Mimic the original ENTRYPOINT of the renovate/renovate Docker container. See
|
||||||
# the following link for this entry.
|
# the following link for this entry.
|
||||||
# https://github.com/renovatebot/renovate/blob/19.175.3/Dockerfile#L220
|
# https://github.com/renovatebot/docker-renovate/blob/d3aa0d99931ea7ad7e901a1e538eba0d61268229/Dockerfile#L63
|
||||||
RENOVATE_TOKEN="${TOKEN}" node /usr/src/app/dist/renovate.js
|
|
||||||
|
RENOVATE_TOKEN="${_RENOVATE_TOKEN}" /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue