MINOR: gh action workflow for go tests #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: go-tests | |
# on: | |
# workflow_dispatch: | |
# push: | |
# branches: | |
# - main | |
# - 'v[0-9]+.[0-9]+.[0-9]+' | |
# pull_request_target: | |
# types: [labeled, opened, synchronize, reopened] | |
# paths: | |
# - "openmetadata-go-client/**" | |
on: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [1.21.x] | |
steps: | |
# begin: setup | |
# TODO: Extra into action composition https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: false | |
swap-storage: true | |
docker-images: false | |
- name: Verify PR labels | |
uses: jesusvasquez333/verify-pr-label-action@v1.4.0 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
github-token: '${{ secrets.GITHUB_TOKEN }}' | |
valid-labels: 'safe to test' | |
pull-request-number: '${{ github.event.pull_request.number }}' | |
disable-reviews: true # To not auto approve changes | |
- name: Checkout OM Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: open-metadata/OpenMetadata | |
path: open-metadata | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Set up Python 3.10.13 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.10.13 | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \ | |
unixodbc-dev libevent-dev python3-dev libkrb5-dev | |
- name: Generate models | |
run: | | |
cd open-metadata | |
python3 -m venv env | |
source env/bin/activate | |
sudo make install_antlr_cli | |
make install_dev generate | |
- name: Install open-metadata dependencies | |
run: | | |
cd open-metadata | |
source env/bin/activate | |
make install_all install_test | |
- name: Start Server and Ingest Sample Data | |
uses: nick-fields/retry@v2.8.3 | |
env: | |
INGESTION_DEPENDENCY: "mysql,elasticsearch" | |
with: | |
timeout_minutes: 60 | |
max_attempts: 2 | |
retry_on: error | |
command: cd open-metadata && ./docker/run_local_docker.sh -m no-ui | |
# end: setup | |
- name: Checkout SDK Repo | |
uses: actions/checkout@v4 | |
with: | |
path: openmetadata-sdk | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Get dependencies | |
run: | | |
cd openmetadata-sdk && make go_install_tools | |
- name: Run tests | |
run: | | |
cd openmetadata-sdk && make go_tests_ci |