Skip to content

Transactions for migations #165

Transactions for migations

Transactions for migations #165

Workflow file for this run

name: Rust
on:
pull_request:
push:
branches:
- main
tags:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install docker for macos
if: startsWith(matrix.os, 'macos-')
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Databases
run: docker compose up -d
- name: Run tests
run: cargo test --verbose
build-binary:
needs: [test]
strategy:
matrix:
include:
- os: linux
image: ubuntu-latest
arch: 386
setup: |
sudo apt-get update
sudo apt-get install -qq gcc-i686-linux-gnu
sudo apt-get install -qq libssl-dev
sudo apt-get install -qq gcc-multilib
env: {}
- os: linux
image: ubuntu-latest
arch: amd64
env: {}
- os: linux
image: ubuntu-latest
arch: arm
setup: |
sudo apt-get update
sudo apt-get install -qq gcc-arm-linux-gnueabi
sudo apt-get install -qq libssl-dev
env:
TARGET: aarch64-unknown-linux-gnu
- os: linux
image: ubuntu-latest
arch: arm64
setup: |
sudo apt-get update
sudo apt-get install -qq gcc-aarch64-linux-gnu
sudo apt-get install -qq libssl-dev
env:
TARGET: aarch64-unknown-linux-gnu
- os: macos
image: macos-latest
arch: amd64
env: {}
- os: macos
image: macos-latest
arch: arm64
env: {}
- os: windows
image: windows-latest
arch: amd64
env:
CC: cl.exe
CFLAGS: -x
TARGET: x86_64-pc-windows-msvc
name: Build (${{ matrix.os }}/${{ matrix.arch }})
runs-on: ${{ matrix.image }}
env: ${{ matrix.env }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup environment
run: ${{ matrix.setup }}
- name: Install compiler for Windows
if: ${{matrix.os == 'windows'}}
id: install_cc
uses: rlalik/setup-cpp-compiler@master
with:
compiler: latest
- if: ${{matrix.os == 'windows'}}
name: Setup MSVC
uses: ilammy/[email protected]
- name: Build
run: cargo build --release --verbose
- name: Rename package
if: ${{matrix.os != 'windows'}}
shell: bash
run: |
cp target/release/geni geni-${{matrix.os}}-${{matrix.arch}}
- name: Rename package
if: ${{matrix.os == 'windows'}}
shell: bash
run: |
cp target/release/geni.exe geni-${{matrix.os}}-${{matrix.arch}}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: geni-${{matrix.os}}-${{matrix.arch}}
- name: Publish to release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: 'geni*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}