Skip to content

Version 0 4 0 dev

Version 0 4 0 dev #63

Workflow file for this run

name: Linux
on:
push:
branches:
- version_0_2_0
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: martypc
runs-on: ubuntu-22.04
steps:
- name: Install nightly Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --default-host x86_64-unknown-linux-gnu --default-toolchain nightly --profile complete
. "$HOME/.cargo/env"
$HOME/.cargo/bin/cargo version
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: >-
sudo apt update && sudo apt install
pkg-config
libasound2-dev
libudev-dev
libc-dev
libx11-dev
libclang-dev
- name: Cache cargo registry, index, and build artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: rust-cache-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
rust-cache-${{ runner.os }}-
- name: Cargo build
run: cargo build --profile release-lto --features use_winit,use_wgpu,sound,opl
- name: Copy files into install dir
run: cp LICENSE README.md CHANGELOG.md CREDITS.md target/release-lto/martypc install
- name: Rename install directory
run: mv install martypc
- name: Create artifact directory
run: mkdir artifacts
# GitHub zips all artifacts, losing file permissions.
# We'll need to tar the directory in order to
# preserve the file permissions
- name: Create artifact from install directory
run: tar cvf artifacts/martypc.tar martypc
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: martypc-linux-gha
path: artifacts/martypc.tar