Skip to content

dev

dev #50

Workflow file for this run

name: Rust
on:
pull_request:
push:
branches:
- '*'
tags:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- 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:
name: build
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
target: [aarch64-unknown-linux-gnu,i686-pc-windows-gnu, i686-pc-windows-msvc, i686-unknown-linux-gnu, x86_64-apple-darwin,x86_64-apple-darwin,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu ]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install deps
run: sudo apt install libssl-dev
- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../geni-${{ matrix.target }}.tar.gz geni
cd -
# FIXME: upload to artifacts
release:
name: release
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
# FIXME: fetch artifacts
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: 'geni*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# FIXME: build docker image and deploy to docker hub