mirror of
https://github.com/dolthub/dolt.git
synced 2026-03-18 09:40:59 -05:00
/{mysql-client-tests-entrypoint.sh, MySQLDockerfile, .github/}: Testing custom action
This commit is contained in:
17
.github/workflows/ci-mysql-client-tests.yaml
vendored
Normal file
17
.github/workflows/ci-mysql-client-tests.yaml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
mysql_client_integrations_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: Run tests
|
||||
steps:
|
||||
# To use this repository's private action,
|
||||
# you must check out the repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Test mysql client integrations
|
||||
uses: ./ # Uses an action in the root directory
|
||||
id: mysql-tests
|
||||
# Use the output from the `hello` step
|
||||
- name: Get the output results
|
||||
run: echo "The results were ${{ steps.mysql-tests.outputs.results }}"
|
||||
@@ -1,68 +0,0 @@
|
||||
name: Test MySQL Integrations
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Bats tests for MySQL integrations
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Setup Go 1.x
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ^1.13
|
||||
id: go
|
||||
- name: Setup Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ^3.6
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ^12
|
||||
- name: Create CI Bin
|
||||
run: |
|
||||
mkdir -p ./.ci_bin
|
||||
echo "::add-path::$(pwd)/.ci_bin"
|
||||
- name: Install Bats
|
||||
run: |
|
||||
npm i bats
|
||||
echo "::add-path::$(pwd)/node_modules/.bin"
|
||||
working-directory: ./.ci_bin
|
||||
- name: Install Dolt
|
||||
working-directory: ./go
|
||||
run: |
|
||||
go build -mod=readonly -o ../.ci_bin/dolt ./cmd/dolt/.
|
||||
go build -mod=readonly -o ../.ci_bin/git-dolt ./cmd/git-dolt/.
|
||||
go build -mod=readonly -o ../.ci_bin/git-dolt-smudge ./cmd/git-dolt-smudge/.
|
||||
go build -mod=readonly -o ../.ci_bin/remotesrv ./utils/remotesrv/.
|
||||
- name: Setup Dolt Config
|
||||
run: |
|
||||
dolt config --global --add user.name 'Liquidata Actions'
|
||||
dolt config --global --add user.email 'actions@liquidata.co'
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '9.0.4' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
- name: Install mysql connector for java
|
||||
run: |
|
||||
curl -L -o /mysql-client-tests/java/mysql-connector-java-8.0.21.jar \
|
||||
https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.21/mysql-connector-java-8.0.21.jar
|
||||
- name: Install python deps
|
||||
run: |
|
||||
pip3 install mysql-connector-python
|
||||
pip3 install PyMySQL
|
||||
- name: Install node deps
|
||||
working-directory: ./mysql-client-tests/node
|
||||
run: npm install
|
||||
- name: Test all
|
||||
run: |
|
||||
bats --tap mysql-client-tests.bats
|
||||
working-directory: ./mysql-client-tests
|
||||
13
ACTIONS-README.md
Normal file
13
ACTIONS-README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Dolt MySQL client integration docker action
|
||||
|
||||
This action runs ./mysql-client-tests in docker.
|
||||
|
||||
## Outputs
|
||||
|
||||
### `results`
|
||||
|
||||
The results of the tests.
|
||||
|
||||
## Example usage
|
||||
|
||||
uses: actions/mysql-client-test-action@v1
|
||||
@@ -1,6 +1,15 @@
|
||||
FROM golang:1.15.0-buster as builder
|
||||
WORKDIR /root/building/go
|
||||
COPY ./go/ .
|
||||
|
||||
# install dolt from source
|
||||
ENV GOFLAGS="-mod=readonly"
|
||||
RUN go build -o dolt ./cmd/dolt
|
||||
|
||||
FROM ubuntu:18.04
|
||||
COPY --from=builder /root/building/go/dolt /usr/local/bin/dolt
|
||||
COPY ./mysql-client-tests /mysql-client-tests
|
||||
COPY ./go /dolt-go
|
||||
COPY ./mysql-client-tests-entrypoint.sh /mysql-client-tests/entrypoint.sh
|
||||
|
||||
# install python
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
@@ -21,8 +30,7 @@ RUN apt-get -y install curl
|
||||
RUN pip3 install mysql-connector-python
|
||||
RUN pip3 install PyMySQL
|
||||
|
||||
# install java
|
||||
# Install OpenJDK-8
|
||||
# install OpenJDK-8
|
||||
RUN apt-get update && \
|
||||
apt-get install -y openjdk-8-jdk && \
|
||||
apt-get install -y ant && \
|
||||
@@ -49,18 +57,16 @@ RUN cat /etc/apt/sources.list.d/nodesource.list
|
||||
RUN apt -y install nodejs
|
||||
|
||||
# install bats
|
||||
RUN apt-get update
|
||||
RUN apt-get install bats
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y install bats
|
||||
|
||||
# install dolt TODO build from source
|
||||
RUN curl -L https://github.com/liquidata-inc/dolt/releases/latest/download/install.sh | bash
|
||||
RUN dolt version
|
||||
|
||||
# setup dolt config
|
||||
RUN dolt config --global --add metrics.disabled true
|
||||
RUN dolt config --global --add metrics.host localhost
|
||||
RUN dolt config --global --add user.name mysql-test-runner
|
||||
RUN dolt config --global --add user.email mysql-test-runner@liquidata.co
|
||||
#RUN dolt config --global --add metrics.disabled true
|
||||
#RUN dolt config --global --add metrics.host localhost
|
||||
#RUN dolt config --global --add user.name mysql-test-runner
|
||||
#RUN dolt config --global --add user.email mysql-test-runner@liquidata.co
|
||||
|
||||
# install node deps
|
||||
WORKDIR /mysql-client-tests/node
|
||||
@@ -69,3 +75,4 @@ RUN npm install
|
||||
# run tests
|
||||
WORKDIR /mysql-client-tests
|
||||
#CMD ["bats", "mysql-client-tests.bats"]
|
||||
ENTRYPOINT ["/mysql-client-tests/entrypoint.sh"]
|
||||
|
||||
8
action.yaml
Normal file
8
action.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
name: 'Dolt MySQL client integration tests'
|
||||
description: 'Smoke tests for mysql client integrations'
|
||||
outputs:
|
||||
results: # logged test results output
|
||||
description: 'The results of the tests'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'MySQLDockerfile'
|
||||
13
mysql-client-tests-entrypoint.sh
Executable file
13
mysql-client-tests-entrypoint.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
pwd
|
||||
ls -a
|
||||
dolt config --global --add metrics.disabled true
|
||||
dolt config --global --add metrics.host localhost
|
||||
dolt config --global --add user.name mysql-test-runner
|
||||
dolt config --global --add user.email mysql-test-runner@liquidata.co
|
||||
|
||||
bats -v
|
||||
|
||||
results=$(bats /mysql-client-tests/mysql-client-tests.bats)
|
||||
echo "::set-output name=results::$results"
|
||||
Reference in New Issue
Block a user