Skip to content

PyPECOS

PyPECOS #5

Workflow file for this run

name: PECOS Rust Workflow
on:
push:
branches:
- master
- development
tags:
- "*"
pull_request:
branches:
- master
- development
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Compile tests
run: >
cargo test --all-features --no-run
-p pecos-sim
-p pecos-cli
- name: Run tests
run: >
cargo test --all-features
-p pecos-sim
-p pecos-cli
# TODO: Check for linting/formatting
# TODO: Add integration tests
#integration-test:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ ubuntu-latest, macos-latest, windows-latest ]
# steps:
# - uses: actions/checkout@v4
#
# - name: Set up Rust
# run: rustup show
#
# - name: Cache Rust
# uses: Swatinem/rust-cache@v2
#
# - name: Compile integration tests
# run: cargo test --all-features -p pecos --test --no-run
#
# - name: Run integration tests
# run: cargo test --all-features -p pecos --test
publish:
needs: [test, ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Log in to crates.io
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish crate
run: |
cd crates/pecos && cargo publish || echo "pecos already published"
cd ../../crates/pecos-sim && cargo publish || echo "pecos-sim already published"