Skip to content

maybe good things will happen if you merge this pr #42

maybe good things will happen if you merge this pr

maybe good things will happen if you merge this pr #42

Workflow file for this run

name: Rust
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
project: pretty-derby
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-20.04
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Cache Rustup
uses: actions/cache@v4
with:
path: |
~/.rustup/settings.toml
~/.rustup/toolchains/${{ matrix.target }}-*
~/.rustup/toolchains/${{ matrix.target }}-*
key: toolchain-${{ matrix.target }}
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: Run tests
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
- name: Upload
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: ${{ env.project }}-${{ matrix.target }}
path: |
./target/${{ matrix.target }}/release/${{ env.project }}
./target/${{ matrix.target }}/release/${{ env.project }}.exe
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Archives
run: find artifacts -mindepth 1 -maxdepth 1 -exec tar -C {} -cvzf {}.tar.gz . \;
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/*.tar.gz