Skip to content

Commit

Permalink
Merge pull request #90 from cold-brewed/gha-enable
Browse files Browse the repository at this point in the history
Add workflow files to enable GitHub Actions
  • Loading branch information
dbalsom authored Feb 21, 2024
2 parents 1c34aab + 705f0b3 commit 317f511
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 0 deletions.
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

0 comments on commit 317f511

Please sign in to comment.