name: EMGen CI
on:
push:
branches:
- main
tags:
- 'emgen-*'
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database:
- 2019
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- name: Start SQL Server ${{matrix.database}}
run: DOCKER_BUILDKIT=1 docker compose up -d mssql-${{matrix.database}}
- name: Run tests
run: cargo test
- name: Stop SQL Server ${{matrix.database}}
if: always()
run: docker compose down mssql-${{matrix.database}}
publish:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish