use matrix for CI

This commit is contained in:
hinto.janai 2023-05-30 10:30:22 -04:00
parent 17d0a91fef
commit 2457f9fed2
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
7 changed files with 53 additions and 98 deletions

48
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "full"
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, macos-11, ubuntu-20.04]
build: [dev, release]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo
target
key: ${{ matrix.os }}-${{ matrix.build }}
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install -y libgtk-3-dev
fi
shell: bash
- name: Test
run: cargo test --all-features --profile ${{ matrix.build }}
- name: Build
run: cargo build --all-features --profile ${{ matrix.build }}

View file

@ -1,7 +1,7 @@
# Attempts to download all files from `gupax.io`
# and verify the SHA256SUMS & PGP signature.
name: Download & Verify `gupax.io`
name: gupax.io
on:
schedule:
- cron: "0 2 * * *"

View file

@ -1,34 +0,0 @@
name: Linux
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache
uses: actions/cache@v3.2.3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: linux
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libgtk-3-dev
- name: Build
run: cargo build
- name: Test
run: cargo test

View file

@ -1,30 +0,0 @@
name: macOS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: macos-latest
steps:
- name: Cache
uses: actions/cache@v3.2.3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: macos
- uses: actions/checkout@v3
- name: Build
run: cargo build
- name: Test
run: cargo test

View file

@ -1,30 +0,0 @@
name: Windows
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: windows-latest
steps:
- name: Cache
uses: actions/cache@v3.2.3
with:
path: |
~\.cargo\registry
~\.cargo\git
target
key: windows
- uses: actions/checkout@v3
- name: Build
run: cargo build
- name: Test
run: cargo test

View file

@ -5,9 +5,7 @@ Gupax is a GUI for mining [**Monero**](https://github.com/monero-project/monero)
**To see a 3-minute video guide on how to set-up Gupax: [click here.](#Guide)**
[![Windows](https://github.com/hinto-janai/gupax/actions/workflows/windows.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/windows.yml) [![macOS](https://github.com/hinto-janai/gupax/actions/workflows/macos.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/macos.yml) [![Linux](https://github.com/hinto-janai/gupax/actions/workflows/linux.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/linux.yml)
[![Remote Node Ping](https://github.com/hinto-janai/gupax/actions/workflows/ping.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/ping.yml)
[![CI](https://github.com/hinto-janai/gupax/actions/workflows/ci.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/ci.yml) [![gupax.io](https://github.com/hinto-janai/gupax/actions/workflows/download.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/download.yml) [![Remote Node Ping](https://github.com/hinto-janai/gupax/actions/workflows/ping.yml/badge.svg)](https://github.com/hinto-janai/gupax/actions/workflows/ping.yml)
</div>

View file

@ -57,6 +57,7 @@ use std::os::unix::fs::PermissionsExt;
// State file
const ERROR: &str = "Disk error";
const PATH_ERROR: &str = "PATH for state directory could not be not found";
#[cfg(target_os = "windows")]
const DIRECTORY: &str = r#"Gupax\"#;
#[cfg(target_os = "macos")]
@ -104,8 +105,10 @@ pub const DEFAULT_P2POOL_PATH: &str = "p2pool/p2pool";
#[cfg(target_os = "linux")]
#[cfg(not(feature = "distro"))]
pub const DEFAULT_XMRIG_PATH: &str = "xmrig/xmrig";
#[cfg(target_os = "linux")]
#[cfg(feature = "distro")]
pub const DEFAULT_P2POOL_PATH: &str = "/usr/bin/p2pool";
#[cfg(target_os = "linux")]
#[cfg(feature = "distro")]
pub const DEFAULT_XMRIG_PATH: &str = "/usr/bin/xmrig";