Skip to content

add ci test

add ci test #2

Workflow file for this run

name: main
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- 'main'
types: [opened, synchronize]
pull_request_target:
branches:
- 'main'
types: [labeled]
jobs:
test:
name: test
runs-on: ubuntu-latest
if: >
${{
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')) ||
startsWith(github.ref, 'refs/tags/')
}}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: lint
run: ./gradlew spotlessCheck
- name: Write test secret to file
run: envsubst < ci/config_template.yml > test-config.yml
env:
SERVER_HOSTNAME: ${{ secrets.TEST_SERVER_HOSTNAME }}
HTTP_PATH: ${{ secrets.TEST_HTTP_PATH }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.TEST_PERSONAL_ACCESS_TOKEN }}
CATALOG_NAME: ${{ secrets.TEST_CATALOG_NAME }}
SCHEMA_NAME: ${{ secrets.TEST_SCHEMA_NAME }}
TABLE_PREFIX: ${{ secrets.TEST_TABLE_PREFIX }}
ANOTHER_CATALOG_NAME: ${{ secrets.TEST_ANOTHER_CATALOG_NAME }}
- run: ./gradlew test
env:
EMBULK_INPUT_DATABRICKS_TEST_CONFIG: "./test-config.yml"
build:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
needs: [ test ]
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: push gem
uses: trocco-io/push-gem-to-gpr-action@v1
with:
language: java
gem-path: "./pkg/*.gem"
github-token: "${{ secrets.GITHUB_TOKEN }}"