Skip to content

Commit

Permalink
chore: Create unit tests workflow (#1910)
Browse files Browse the repository at this point in the history
* chore: Update for Rust 1.72.0

Rust 1.72.0 has introduced a bunch of new lints. Here we fix them all.

`let ... else` finally gets formatted.

* chire: Create unit tests workflow

* Rename and remove useless steps

* remove env vars

* Add concurrency group

* Test unit workflow on 4 cores

* Add mysql service to unit tests

* test 8 cores runner

---------

Co-authored-by: chubei <914745487@qq.com>
  • Loading branch information
mediuminvader and chubei committed Aug 29, 2023
1 parent 931ef30 commit 25f368e
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Unit Tests

on:
workflow_dispatch:
# pull_request_target:
# branches: [main]
merge_group:

env:
CARGO_TERM_COLOR: always

concurrency:
group: ci/${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout

jobs:
# Run unit tests
unit:
timeout-minutes: 60
runs-on:
group: Org Larger Runners
labels: ubuntu-latest-8-cores
services:
postgres:
image: debezium/postgres:13
ports:
- 5434:5432
env:
POSTGRES_DB: dozer_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ALLOW_IP_RANGE: 0.0.0.0/0
# command: postgres -c hba_file=/var/lib/stock-sample/pg_hba.conf
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: dozer-coverage
aws-region: us-east-2

- if: github.event_name == 'pull_request_target'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- if: github.event_name != 'pull_request_target'
uses: actions/checkout@v3

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Rust cache
uses: swatinem/rust-cache@v2

- name: MongoDB in GitHub Actions
uses: supercharge/mongodb-github-action@1.8.0

- uses: ./.github/workflows/setup-snowflake-and-kafka

- uses: ./.github/workflows/setup-mysql-and-mariadb

- name: Run connectors tests
env:
SN_SERVER: ${{ secrets.SN_SERVER }}
SN_USER: ${{ secrets.SN_USER }}
SN_PASSWORD: ${{ secrets.SN_PASSWORD }}
SN_DATABASE: ${{ secrets.SN_DATABASE }}
SN_WAREHOUSE: ${{ secrets.SN_WAREHOUSE }}
SN_DRIVER: ${{ secrets.SN_DRIVER }}
shell: bash
run: |
cargo test test_connector_ --lib --features snowflake,ethereum,kafka,python --no-fail-fast -- --ignored
- name: Run tests
shell: bash
run: |
source ./dozer-tests/python_udf/virtualenv.sh
cargo test --features snowflake,ethereum,kafka,python,mongodb --no-fail-fast

0 comments on commit 25f368e

Please sign in to comment.