Skip to content

Commit

Permalink
adds ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dilawar committed Oct 6, 2024
1 parent d865e40 commit 80ab9f5
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Rust

on:
push:
branches: ["main"]
tags:
- "v*"
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
linux-build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true

- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --all-features --verbose

mac-build-test:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --all-features --verbose

windows-build-test:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --all-features --verbose

create-release:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
if: startsWith(github.event.ref, 'refs/tags/v')
needs: create-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: mpm
target: ${{ matrix.target }}
tar: unix
zip: windows
token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 80ab9f5

Please sign in to comment.