Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow files to enable GitHub Actions #90

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
run: >-
sudo apt update && sudo apt install
libasound2-dev
libudev-dev

- name: Cargo build
run: cargo build -r --features ega

- name: Copy files into install dir
run: cp README.md target/release/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${{ github.run_number }}'
path: artifacts/martypc.tar
79 changes: 79 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: macOS

on:
push:
branches:
- version_0_2_0
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
macos-arm:
name: martypc (arm)
runs-on: macos-14

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cargo build
run: cargo build -r --features ega

- name: Copy files into install dir
run: cp README.md target/release/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-${{ github.job }}-gha${{ github.run_number }}'
path: artifacts/martypc.tar

macos-x86:
name: martypc (x86)
runs-on: macos-13

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cargo build
run: cargo build -r --features ega

- name: Copy files into install dir
run: cp README.md target/release/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-${{ github.job }}-gha${{ github.run_number }}'
path: artifacts/martypc.tar
54 changes: 54 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Windows

on:
push:
branches:
- version_0_2_0
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
msys2:
name: martypc
runs-on: windows-2022

defaults:
run:
shell: msys2 {0}

strategy:
matrix:
environment:
- msystem: MINGW64
prefix: mingw-w64-x86_64
steps:
- name: Prepare MSYS2 environment
uses: msys2/setup-msys2@v2
with:
release: false
update: true
msystem: ${{ matrix.environment.msystem }}
pacboy: >-
rust:p

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cargo build
run: cargo build -r --features ega

- name: Copy files into install dir
run: cp README.md target/release/martypc install

- name: Rename install directory
run: mv install martypc

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: 'martypc-windows-gha${{ github.run_number }}'
path: martypc