Skip to content

Modified the workflows to use actions/cache@v4 #2

Modified the workflows to use actions/cache@v4

Modified the workflows to use actions/cache@v4 #2

Workflow file for this run

name: Build
on:
push:
paths:
- '.github/workflows/push.yml'
- '.github/workflows/master.yml'
- 'packages/**'
- '.eslintrc.js'
- '.prettierrc'
- 'package.json'
- 'lerna.json'
- 'rollup.config.js'
- 'yarn.lock'
- 'docs-gen/**'
- 'docs/**'
pull_request:
paths:
- '.github/workflows/push.yml'
- '.github/workflows/master.yml'
- 'packages/**'
- '.eslintrc.js'
- '.prettierrc'
- 'package.json'
- 'lerna.json'
- 'rollup.config.js'
- 'yarn.lock'
- 'docs-gen/**'
- 'docs/**'
jobs:
unit:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore lerna
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn install
uses: borales/[email protected]
with:
cmd: install --frozen-lockfile
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
- name: Lerna test
run: yarn lerna run --concurrency 1 unit
lint:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore lerna
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn install
uses: borales/[email protected]
with:
cmd: install --frozen-lockfile
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna lint
run: yarn lerna run --concurrency 1 lint
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore lerna
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn install
uses: borales/[email protected]
with:
cmd: install --frozen-lockfile
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Check Yarn lock wasn't modified
run: if [ "$(git status | grep nothing)x" = "x" ]; then echo "Non empty changeset after lerna bootstrap"; git status; exit 1; else echo "Nothing to commit. Proceeding"; fi;
- name: Build Core Client libraries
run: yarn build
- name: Build other packages
run: yarn lerna run --concurrency 1 build
integration-wrk-1:
runs-on: ubuntu-latest
timeout-minutes: 60
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: [12.x]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore lerna
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn install
uses: borales/[email protected]
with:
cmd: install --frozen-lockfile
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
- name: Run Redis Integration
timeout-minutes: 10
run: |
yarn lerna run --concurrency 1 integration:redis
- name: Run Postgres Integration with 9.6
timeout-minutes: 10
run: |
docker pull postgres:${TEST_PGSQL_VERSION}
yarn lerna run --concurrency 1 integration:postgres
env:
TEST_PGSQL_VERSION: 9.6
- name: Run Postgres Integration with 10
timeout-minutes: 10
run: |
docker pull postgres:${TEST_PGSQL_VERSION}
yarn lerna run --concurrency 1 integration:postgres
env:
TEST_PGSQL_VERSION: 10
- name: Run Postgres Integration with 11
timeout-minutes: 10
run: |
docker pull postgres:${TEST_PGSQL_VERSION}
yarn lerna run --concurrency 1 integration:postgres
env:
TEST_PGSQL_VERSION: 11
- name: Run Postgres Integration with 12
timeout-minutes: 10
run: |
docker pull postgres:${TEST_PGSQL_VERSION}
yarn lerna run --concurrency 1 integration:postgres
env:
TEST_PGSQL_VERSION: 12
- name: Run MS SQL Integration with 2017-latest
timeout-minutes: 10
run: |
docker pull mcr.microsoft.com/mssql/server:${TEST_MSSQL_VERSION}
yarn lerna run --concurrency 1 integration:mssql
env:
TEST_MSSQL_VERSION: 2017-latest
- name: Run MS SQL Integration with 2019-latest
timeout-minutes: 10
run: |
docker pull mcr.microsoft.com/mssql/server:${TEST_MSSQL_VERSION}
yarn lerna run --concurrency 1 integration:mssql
env:
TEST_MSSQL_VERSION: 2019-latest
integration-wrk-2:
runs-on: ubuntu-latest
timeout-minutes: 60
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: [12.x]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore lerna
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn install
uses: borales/[email protected]
with:
cmd: install --frozen-lockfile
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
- name: Run MySQL Integration with 5.6
timeout-minutes: 10
run: |
docker pull mysql:${TEST_MYSQL_VERSION}
yarn lerna run --concurrency 1 integration:mysql
env:
TEST_MYSQL_VERSION: 5.6
- name: Run MySQL Integration with 5.7
timeout-minutes: 10
run: |
docker pull mysql:${TEST_MYSQL_VERSION}
yarn lerna run --concurrency 1 integration:mysql
env:
TEST_MYSQL_VERSION: 5.7
- name: Run Clickhouse Integration with 20.6
timeout-minutes: 10
run: |
docker pull yandex/clickhouse-server:${TEST_CLICKHOUSE_VERSION}
yarn lerna run --concurrency 1 integration:clickhouse
env:
TEST_CLICKHOUSE_VERSION: 20.6
- name: Run Clickhouse Integration with 20
timeout-minutes: 10
run: |
docker pull yandex/clickhouse-server:${TEST_CLICKHOUSE_VERSION}
yarn lerna run --concurrency 1 integration:clickhouse
env:
TEST_CLICKHOUSE_VERSION: 20
- name: Run Clickhouse Integration with 19
timeout-minutes: 10
run: |
docker pull yandex/clickhouse-server:${TEST_CLICKHOUSE_VERSION}
yarn lerna run --concurrency 1 integration:clickhouse
env:
TEST_CLICKHOUSE_VERSION: 19
integration-wrk-3:
runs-on: ubuntu-latest
timeout-minutes: 60
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: [12.x]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore lerna
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn install
uses: borales/[email protected]
with:
cmd: install --frozen-lockfile
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
- name: Run PrestoDB Integration with Postgres 12.4
timeout-minutes: 15
run: |
docker pull lewuathe/presto-coordinator:${TEST_PRESTO_VERSION}
docker pull lewuathe/presto-worker:${TEST_PRESTO_VERSION}
docker pull postgres:${TEST_PGSQL_VERSION}
yarn lerna run --concurrency 1 integration:presto
env:
TEST_PGSQL_VERSION: 12.4
TEST_PRESTO_VERSION: 341-SNAPSHOT
- name: Run Druid Integration with 0.0.19
timeout-minutes: 15
run: |
docker pull postgres:${TEST_POSTGRES_VERSION}
docker pull zookeeper:${TEST_ZOOKEEPER_VERSION}
docker pull apache/druid:${TEST_DRUID_VERSION}
yarn lerna run --concurrency 1 integration:druid
env:
TEST_POSTGRES_VERSION: latest
TEST_ZOOKEEPER_VERSION: 3.5
TEST_DRUID_VERSION: 0.19.0
docker-image-latest-set-tag:
# At least git should be completed pushed up until this moment
needs: integration-wrk-1
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get-tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
- id: get-tag
run: echo "::set-output name=tag::$(git tag --contains $GITHUB_SHA)"
env:
GITHUB_SHA: ${{ github.sha }}
docker-image-latest:
needs: docker-image-latest-set-tag
name: Build only :latest image
runs-on: ubuntu-latest
timeout-minutes: 60
if: (!contains(needs['docker-image-latest-set-tag'].outputs.tag, 'v'))
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build only
uses: docker/build-push-action@v2
timeout-minutes: 15
with:
context: ./packages/cubejs-docker
file: ./packages/cubejs-docker/latest.Dockerfile
platforms: linux/amd64
push: false
docker-image-alpine:
needs: docker-image-latest-set-tag
name: Build only :alpine image
runs-on: ubuntu-latest
timeout-minutes: 60
if: (!contains(needs['docker-image-latest-set-tag'].outputs.tag, 'v'))
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build only
uses: docker/build-push-action@v2
timeout-minutes: 15
with:
context: ./packages/cubejs-docker
file: ./packages/cubejs-docker/latest-alpine.Dockerfile
platforms: linux/amd64
push: false
docker-image-dev:
name: Build only :dev image
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build only
uses: docker/build-push-action@v2
timeout-minutes: 15
with:
context: .
file: ./packages/cubejs-docker/dev.Dockerfile
platforms: linux/amd64
push: false