Skip to content

Commit

Permalink
Merge branch 'Salzian:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Peepo-Juice authored Nov 23, 2023
2 parents d52c3c6 + dbf532e commit 37897c8
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .github/actions/install-platform-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Install platform dependencies'
description: 'Installs platform dependencies for the current OS'
inputs:
os:
description: 'The OS to install dependencies for'
required: true

runs:
using: "composite"
steps:
- if: ${{ inputs.os == 'ubuntu-latest' }}
name: Install ubuntu dependencies
shell: bash
run: sudo apt install -y libasound2-dev libudev-dev
16 changes: 16 additions & 0 deletions .github/actions/setup-cache-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Setup Cache'
description: 'Sets up caching for Rust projects'

runs:
using: "composite"
steps:
- name: Setup Cache for Registry and Build Artifacts
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
74 changes: 65 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,79 @@
name: CI
name: Rust CI Workflow

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: true
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Install platform dependencies
uses: ./.github/actions/install-platform-dependencies
with:
os: ${{ matrix.os }}

- name: Setup cache
uses: ./.github/actions/setup-cache-action

- name: Compile project
run: cargo build

# This job is currently disabled because it requires the FMOD libraries to be present.
# We will revisit this once we actually have any tests.
#test:

# needs: build

# strategy:
# fail-fast: true
# matrix:
# os: [ windows-latest, macos-latest, ubuntu-latest ]

# runs-on: ${{ matrix.os }}

# steps:
# - uses: actions/checkout@v3

# - name: Setup cache
# uses: ./.github/actions/setup-cache-action

# - if: matrix.os == 'ubuntu-latest'
# name: (Ubuntu) Install platform dependencies
# run: sudo apt install -y libasound2-dev libudev-dev

# - name: Execute tests
# run: cargo test

lint:
needs: build

runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Build the project
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3

- name: Install platform dependencies
uses: ./.github/actions/install-platform-dependencies
with:
os: ubuntu-latest

- name: Setup cache
uses: ./.github/actions/setup-cache-action

- name: Lint with clippy
run: cargo clippy -- -D warnings

0 comments on commit 37897c8

Please sign in to comment.