2020-03-26 05:59:57 +00:00
|
|
|
name: build
|
2019-12-22 04:45:25 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-02-19 14:13:17 +00:00
|
|
|
- 'renovate/**'
|
2019-12-22 04:45:25 +00:00
|
|
|
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
CI: true
|
2020-03-26 05:59:57 +00:00
|
|
|
DOCKER_REPO: renovate/renovate
|
|
|
|
YARN_CACHE_KEY: v1
|
|
|
|
BUILDX_VERSION: v0.3.1
|
2020-03-26 07:48:38 +00:00
|
|
|
NODE_VERSION: 12
|
2020-03-26 05:59:57 +00:00
|
|
|
# https://github.com/chalk/supports-color/issues/106
|
|
|
|
FORCE_COLOR: true
|
2019-12-22 04:45:25 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-03-26 05:59:57 +00:00
|
|
|
cleanup:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 5
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: github-cleanup
|
|
|
|
uses: renovatebot/gh-action@v0
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
command: github-cleanup
|
|
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
|
|
dry-run: ${{github.ref == 'refs/heads/master'}}
|
|
|
|
|
2019-12-22 04:45:25 +00:00
|
|
|
test:
|
2020-03-26 05:59:57 +00:00
|
|
|
needs: [cleanup]
|
2019-12-22 04:45:25 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2020-04-01 19:35:09 +00:00
|
|
|
# tests shouldn't need more time
|
|
|
|
timeout-minutes: 30
|
2020-02-11 17:21:33 +00:00
|
|
|
|
2019-12-22 04:45:25 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-01-14 08:31:42 +00:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2020-03-26 07:48:38 +00:00
|
|
|
node-version: [12, 10]
|
2019-12-22 04:45:25 +00:00
|
|
|
python-version: [3.8]
|
2020-02-13 20:53:27 +00:00
|
|
|
java-version: [11]
|
2020-02-11 17:21:33 +00:00
|
|
|
exclude:
|
|
|
|
- os: windows-latest
|
|
|
|
node-version: 10
|
2019-12-22 04:45:25 +00:00
|
|
|
|
2020-02-28 09:51:08 +00:00
|
|
|
env:
|
2020-03-23 09:09:50 +00:00
|
|
|
coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 12 }}
|
2020-03-26 07:48:38 +00:00
|
|
|
NODE_VERSION: ${{ matrix.node-version }}
|
|
|
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
|
|
|
JAVA_VERSION: ${{ matrix.java-version }}
|
2020-02-28 11:19:18 +00:00
|
|
|
|
2019-12-22 04:45:25 +00:00
|
|
|
steps:
|
2020-03-26 07:48:38 +00:00
|
|
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
2019-12-22 04:45:25 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-03-26 07:48:38 +00:00
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
2019-12-22 04:45:25 +00:00
|
|
|
|
2020-03-26 07:48:38 +00:00
|
|
|
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
2019-12-22 04:45:25 +00:00
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
2020-03-26 07:48:38 +00:00
|
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
2019-12-22 04:45:25 +00:00
|
|
|
|
2020-03-26 07:48:38 +00:00
|
|
|
- name: Set up Java ${{ env.JAVA_VERSION }}
|
|
|
|
if: env.NODE_VERSION == '12'
|
2020-02-11 09:25:51 +00:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2020-03-26 07:48:38 +00:00
|
|
|
java-version: ${{ env.JAVA_VERSION }}
|
2020-02-11 09:25:51 +00:00
|
|
|
|
2020-02-11 17:21:33 +00:00
|
|
|
- name: Skip Java tests
|
2020-03-26 07:48:38 +00:00
|
|
|
if: env.NODE_VERSION != '12'
|
2020-02-28 11:19:18 +00:00
|
|
|
run: echo "::set-env name=SKIP_JAVA_TESTS::true"
|
2020-02-11 17:21:33 +00:00
|
|
|
|
2019-12-22 04:45:25 +00:00
|
|
|
- name: Init platform
|
|
|
|
id: init
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=yarn_cache::$(yarn cache dir)"
|
|
|
|
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=pip_cache::' + USER_CACHE_DIR)"
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
git config --global core.symlinks true
|
|
|
|
git config --global user.email 'bot@renovateapp.com'
|
|
|
|
git config --global user.name 'Renovate Bot'
|
2020-03-28 11:51:32 +00:00
|
|
|
npm config set scripts-prepend-node-path true
|
2020-03-11 07:52:41 +00:00
|
|
|
echo "Node $(node --version)"
|
2019-12-22 04:45:25 +00:00
|
|
|
python --version
|
2020-03-11 07:52:41 +00:00
|
|
|
echo "Yarn $(yarn --version)"
|
2019-12-22 04:45:25 +00:00
|
|
|
pip --version
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache Yarn packages
|
2020-02-11 19:44:42 +00:00
|
|
|
id: yarn_cache_packages
|
2019-12-22 04:45:25 +00:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ steps.init.outputs.yarn_cache }}
|
2020-03-26 05:59:57 +00:00
|
|
|
key: ${{ env.YARN_CACHE_KEY }}-${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }}
|
2019-12-22 04:45:25 +00:00
|
|
|
restore-keys: |
|
2020-03-26 05:59:57 +00:00
|
|
|
${{ env.YARN_CACHE_KEY }}-${{ runner.os }}-yarn_cache-
|
2019-12-22 04:45:25 +00:00
|
|
|
|
|
|
|
- name: Cache node_modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: node_modules
|
2020-03-26 07:48:38 +00:00
|
|
|
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
2019-12-22 04:45:25 +00:00
|
|
|
restore-keys: |
|
2020-03-26 07:48:38 +00:00
|
|
|
${{ runner.os }}-${{ env.NODE_VERSION }}-yarn-
|
2019-12-22 04:45:25 +00:00
|
|
|
|
|
|
|
- name: Cache pip packages
|
2020-02-11 19:44:42 +00:00
|
|
|
id: pip_cache_packages
|
2019-12-22 04:45:25 +00:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ steps.init.outputs.pip_cache }}
|
2020-03-26 07:48:38 +00:00
|
|
|
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-pip-${{ hashFiles('**/requirements.txt') }}
|
2019-12-22 04:45:25 +00:00
|
|
|
restore-keys: |
|
2020-03-26 07:48:38 +00:00
|
|
|
${{ runner.os }}-${{ env.PYTHON_VERSION }}-pip-
|
2019-12-22 04:45:25 +00:00
|
|
|
|
2020-02-11 19:44:42 +00:00
|
|
|
# Clear caches on cache miss, otherwise they will grow indefinitely
|
|
|
|
- name: Clear yarn cache
|
|
|
|
if: steps.yarn_cache_packages.outputs.cache-hit != 'true'
|
|
|
|
run: yarn cache clean
|
|
|
|
|
|
|
|
- name: Clear pip cache
|
|
|
|
if: steps.pip_cache_packages.outputs.cache-hit != 'true'
|
2020-02-17 08:15:09 +00:00
|
|
|
run: python -c "from pip._internal.locations import USER_CACHE_DIR; from shutil import rmtree; rmtree(USER_CACHE_DIR, ignore_errors=True)"
|
2020-02-11 19:44:42 +00:00
|
|
|
|
2019-12-22 04:45:25 +00:00
|
|
|
- name: Installing dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
yarn install --frozen-lockfile --link-duplicates
|
|
|
|
pip install --user -r requirements.txt
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
|
|
|
|
|
|
|
- name: Unit tests
|
2020-02-28 09:51:08 +00:00
|
|
|
run: yarn jest --maxWorkers=2 --ci --coverage ${{ env.coverage }}
|
2020-04-02 04:01:31 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
2020-02-28 08:25:14 +00:00
|
|
|
|
2020-02-28 11:19:18 +00:00
|
|
|
- name: Upload coverage
|
|
|
|
uses: actions/upload-artifact@v1
|
2020-02-28 09:51:08 +00:00
|
|
|
if: always() && env.coverage == 'true'
|
2020-02-28 11:19:18 +00:00
|
|
|
with:
|
|
|
|
name: coverage
|
|
|
|
path: coverage
|
2019-12-22 04:45:25 +00:00
|
|
|
|
2020-02-28 13:28:23 +00:00
|
|
|
- name: Codecov
|
|
|
|
shell: bash
|
|
|
|
if: always() && env.coverage == 'true'
|
|
|
|
continue-on-error: true
|
|
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|
2019-12-22 04:45:25 +00:00
|
|
|
- name: E2E Test
|
|
|
|
run: yarn test-e2e
|
2020-02-28 09:51:08 +00:00
|
|
|
|
|
|
|
lint:
|
2020-03-26 07:48:38 +00:00
|
|
|
needs: [cleanup]
|
|
|
|
runs-on: ubuntu-latest
|
2020-02-28 09:51:08 +00:00
|
|
|
|
2020-02-28 11:19:18 +00:00
|
|
|
# lint shouldn't need more than 10 min
|
2020-04-01 19:35:09 +00:00
|
|
|
timeout-minutes: 15
|
2020-02-28 09:51:08 +00:00
|
|
|
|
|
|
|
steps:
|
2020-03-26 07:48:38 +00:00
|
|
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
2020-02-28 09:51:08 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-03-26 07:48:38 +00:00
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
2020-02-28 09:51:08 +00:00
|
|
|
|
|
|
|
- name: Init platform
|
|
|
|
id: init
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=yarn_cache::$(yarn cache dir)"
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
git config --global core.symlinks true
|
|
|
|
git config --global user.email 'bot@renovateapp.com'
|
|
|
|
git config --global user.name 'Renovate Bot'
|
2020-03-28 11:51:32 +00:00
|
|
|
npm config set scripts-prepend-node-path true
|
2020-03-11 07:52:41 +00:00
|
|
|
echo "Node $(node --version)"
|
2020-02-28 09:51:08 +00:00
|
|
|
python --version
|
2020-03-11 07:52:41 +00:00
|
|
|
echo "Yarn $(yarn --version)"
|
2020-02-28 09:51:08 +00:00
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache Yarn packages
|
|
|
|
id: yarn_cache_packages
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ steps.init.outputs.yarn_cache }}
|
2020-03-26 05:59:57 +00:00
|
|
|
key: ${{ env.YARN_CACHE_KEY }}-${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }}
|
2020-02-28 09:51:08 +00:00
|
|
|
restore-keys: |
|
2020-03-26 05:59:57 +00:00
|
|
|
${{ env.YARN_CACHE_KEY }}-${{ runner.os }}-yarn_cache-
|
2020-02-28 09:51:08 +00:00
|
|
|
|
|
|
|
- name: Cache node_modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: node_modules
|
2020-03-26 07:48:38 +00:00
|
|
|
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
2020-02-28 09:51:08 +00:00
|
|
|
restore-keys: |
|
2020-03-26 07:48:38 +00:00
|
|
|
${{ runner.os }}-${{ env.NODE_VERSION }}-yarn-
|
2020-02-28 09:51:08 +00:00
|
|
|
|
|
|
|
# Clear caches on cache miss, otherwise they will grow indefinitely
|
|
|
|
- name: Clear yarn cache
|
|
|
|
if: steps.yarn_cache_packages.outputs.cache-hit != 'true'
|
|
|
|
run: yarn cache clean
|
|
|
|
|
|
|
|
- name: Installing dependencies
|
|
|
|
run: yarn install --frozen-lockfile --link-duplicates
|
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: yarn lint
|
|
|
|
|
|
|
|
- name: Test schema
|
|
|
|
run: yarn test-schema
|
|
|
|
|
|
|
|
- name: Type check
|
|
|
|
run: yarn type-check
|
2020-03-26 05:59:57 +00:00
|
|
|
|
|
|
|
test-docker:
|
|
|
|
needs: cleanup
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
timeout-minutes: 15
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Docker Buildx ${{ env.BUILDX_VERSION }}
|
|
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
|
|
with:
|
|
|
|
version: ${{ env.BUILDX_VERSION }}
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build the Docker images
|
|
|
|
run: |
|
|
|
|
docker buildx bake \
|
2020-03-26 14:32:47 +00:00
|
|
|
--progress plain \
|
2020-03-26 05:59:57 +00:00
|
|
|
--file docker/bake.hcl \
|
|
|
|
--set settings.output=type=docker \
|
|
|
|
default
|
|
|
|
|
|
|
|
- name: Test the Docker images
|
|
|
|
run: |
|
|
|
|
docker run --rm -t ${DOCKER_REPO} --version
|
|
|
|
docker run --rm -t ${DOCKER_REPO}:slim --version
|
|
|
|
|
|
|
|
- name: Image history latest
|
|
|
|
run: docker history ${DOCKER_REPO}
|
|
|
|
- name: Image history slim
|
|
|
|
run: docker history ${DOCKER_REPO}:slim
|
|
|
|
|
|
|
|
- name: Images size
|
|
|
|
run: docker image ls | grep ${DOCKER_REPO}
|
|
|
|
|
|
|
|
release:
|
|
|
|
needs: [lint, test, test-docker]
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-29 15:31:30 +00:00
|
|
|
# release shouldn't need more than 5 min
|
2020-04-01 19:35:09 +00:00
|
|
|
timeout-minutes: 15
|
2020-03-26 07:48:38 +00:00
|
|
|
|
2020-03-26 05:59:57 +00:00
|
|
|
steps:
|
2020-03-26 07:48:38 +00:00
|
|
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
|
|
|
|
- name: Init platform
|
|
|
|
id: init
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=yarn_cache::$(yarn cache dir)"
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
git config --global core.symlinks true
|
|
|
|
git config --global user.email 'bot@renovateapp.com'
|
|
|
|
git config --global user.name 'Renovate Bot'
|
|
|
|
yarn config set version-git-tag false
|
2020-03-28 11:51:32 +00:00
|
|
|
npm config set scripts-prepend-node-path true
|
2020-03-26 07:48:38 +00:00
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache Yarn packages
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ steps.init.outputs.yarn_cache }}
|
|
|
|
key: ${{ env.YARN_CACHE_KEY }}-${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
|
|
|
|
- name: Cache node_modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: node_modules
|
|
|
|
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
|
|
|
|
- name: Installing dependencies
|
|
|
|
run: yarn install --frozen-lockfile --link-duplicates
|
|
|
|
|
|
|
|
- name: semantic-release
|
|
|
|
run: |
|
2020-03-28 11:51:32 +00:00
|
|
|
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
|
|
|
|
npx semantic-release --dry-run ${{github.ref != 'refs/heads/master'}} --ci ${{github.ref == 'refs/heads/master'}}
|
2020-03-26 07:48:38 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
2020-03-28 11:51:32 +00:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|