Skip to content

Merge pull request #11 from Reloaded-Project/add-friendly-target-names #655

Merge pull request #11 from Reloaded-Project/add-friendly-target-names

Merge pull request #11 from Reloaded-Project/add-friendly-target-names #655

name: Test Build Workflow
on:
schedule:
- cron: "0 0 * * *" # Run daily at midnight
workflow_dispatch:
push:
tags:
- "v1"
- "v1-test"
paths:
- "action.yml"
- ".github/workflows/test-build-workflow.yml"
pull_request:
branches: [v1-master]
paths:
- "action.yml"
- ".github/workflows/test-build-workflow.yml"
jobs:
test-binary-build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-pgo: true
use-cross: false
- os: ubuntu-latest
target: i686-unknown-linux-gnu
use-pgo: true
use-cross: false
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use-pgo: true # x64 host to aarch64 simulated guest via cross
use-cross: true
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
use-pgo: true # x64 host to armv7 simulated guest via cross
use-cross: true
- os: windows-latest
target: x86_64-pc-windows-msvc
use-pgo: true
use-cross: false
- os: windows-latest
target: i686-pc-windows-msvc
use-pgo: true
use-cross: false
- os: windows-latest
target: aarch64-pc-windows-msvc
use-pgo: false # no virtualization support (proprietary OS)
use-cross: false
- os: macos-15-intel # x86
target: x86_64-apple-darwin
use-pgo: true
use-cross: false
- os: macos-latest # M1
target: aarch64-apple-darwin
use-pgo: true
use-cross: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Binary Build
uses: ./
with:
target: ${{ matrix.target }}
use-pgo: ${{ matrix.use-pgo }}
use-cross: ${{ matrix.use-cross }}
rust-project-path: "test-project/tools/cli"
pgo-project-path: "test-project"
crate-name: "prs-rs-cli"
upload-artifacts: false
test-build-without-native-host-tools:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Android Armv7 Build
uses: ./
with:
rust-project-path: test-project/tools/cli
crate-name: prs-rs-cli
target: armv7-linux-androideabi
use-cross: true
upload-artifacts: false
test-library-build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-pgo: true
use-cross: false
use-tarpaulin: true
- os: ubuntu-latest
target: i686-unknown-linux-gnu
use-pgo: true
use-cross: false
use-tarpaulin: true
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use-pgo: true # x64 host to aarch64 simulated guest via cross
use-cross: true
use-tarpaulin: true
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
use-pgo: true # x64 host to armv7 simulated guest via cross
use-cross: true
use-tarpaulin: true
- os: windows-latest
target: x86_64-pc-windows-msvc
use-pgo: true
use-cross: false
use-tarpaulin: true
- os: windows-latest
target: i686-pc-windows-msvc
use-pgo: true
use-cross: false
use-tarpaulin: true
# no native github actions runner or cross-rs image
#- os: windows-latest
# target: aarch64-pc-windows-msvc
# use-pgo: false # no native runner
# use-cross: false
# use-tarpaulin: true
- os: macos-15-intel # x86
target: x86_64-apple-darwin
use-pgo: true
use-cross: false
use-tarpaulin: true
- os: macos-latest # M1
target: aarch64-apple-darwin
use-pgo: true
use-cross: false
use-tarpaulin: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Library Build
uses: ./
with:
crate-name: prs-rs
target: ${{ matrix.target }}
use-pgo: ${{ matrix.use-pgo }}
use-cross: ${{ matrix.use-cross }}
use-tarpaulin: ${{ matrix.use-tarpaulin }}
features: "c-exports"
build-library: true
upload-artifacts: false
run-tests-and-coverage: true
upload-coverage-to-codecov: false
rust-project-path: test-project
pgo-project-path: test-project
workspace-path: test-project
# This tests gathering PGO data on a host, and building for a different target.
test-pgo-with-cross-compile:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test PGO with Cross-Compilation (Binary)
uses: ./
with:
rust-project-path: test-project/tools/cli
pgo-project-path: test-project
crate-name: prs-rs-cli
target: aarch64-unknown-linux-gnu # x64 host to aarch64 simulated guest
use-pgo: true
use-cross: true
pgo-benchmark-name: my_benchmark
upload-artifacts: false
- name: Test PGO with Cross-Compilation (Library)
uses: ./
with:
crate-name: prs-rs
rust-project-path: test-project
pgo-project-path: test-project
target: aarch64-unknown-linux-gnu # x64 host to to aarch64 simulated guest
use-pgo: true
use-cross: true
pgo-benchmark-name: my_benchmark
upload-artifacts: false
build-library: true
test-library-feature-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Library Feature Build
uses: ./
with:
crate-name: prs-rs
rust-project-path: test-project
target: x86_64-unknown-linux-gnu
features: c-exports,std
upload-artifacts: false
build-library: true
test-library-no-default-features:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Library No Default Features
uses: ./
with:
crate-name: prs-rs
rust-project-path: test-project
target: x86_64-unknown-linux-gnu
no-default-features: true
features: std
upload-artifacts: false
build-library: true
test-binary-pgo-with-library:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Binary PGO with Library
uses: ./
with:
rust-project-path: test-project/tools/cli
pgo-project-path: test-project
crate-name: prs-rs-cli
target: x86_64-unknown-linux-gnu
use-pgo: true
pgo-benchmark-name: my_benchmark
upload-artifacts: false
test-library-pgo:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Library PGO
uses: ./
with:
crate-name: prs-rs
rust-project-path: test-project
pgo-project-path: test-project
target: x86_64-unknown-linux-gnu
use-pgo: true
pgo-benchmark-name: my_benchmark
upload-artifacts: false
build-library: true
test-custom-rustflags:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Custom RUSTFLAGS (Binary)
uses: ./
with:
rust-project-path: test-project/tools/cli
crate-name: prs-rs-cli
target: x86_64-unknown-linux-gnu
additional-rustflags: -C opt-level=3
upload-artifacts: false
- name: Test Custom RUSTFLAGS (Library)
uses: ./
with:
crate-name: prs-rs
rust-project-path: test-project
target: x86_64-unknown-linux-gnu
additional-rustflags: -C opt-level=3
upload-artifacts: false
build-library: true
test-custom-build-std:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Custom RUSTFLAGS (Binary)
uses: ./
with:
rust-project-path: test-project/tools/cli
crate-name: prs-rs-cli
target: x86_64-unknown-linux-gnu
additional-rustflags: -C opt-level=3
upload-artifacts: false
size-optimized-std: true
- name: Test Custom RUSTFLAGS (Library)
uses: ./
with:
crate-name: prs-rs
rust-project-path: test-project
target: x86_64-unknown-linux-gnu
additional-rustflags: -C opt-level=3
upload-artifacts: false
build-library: true
size-optimized-std: true
test-custom-rustc-args:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test Custom rustc Args (Binary)
uses: ./
with:
rust-project-path: test-project/tools/cli
crate-name: prs-rs-cli
target: x86_64-unknown-linux-gnu
additional-rustc-args: --all-features
upload-artifacts: false
# Can build a project in a workspace.
# It's important caching works for both projects here; so check logs even
# if this passes.
test-workspace-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/dxt-lossless-transform
ref: d47afd9a7c2fa71495b6d942853b0fe41f258e26
path: test-project
- name: Test Workspace Build (API)
uses: ./
with:
rust-project-path: test-project/projects/dxt-lossless-transform-api
workspace-path: "test-project"
crate-name: dxt-lossless-transform-api
target: x86_64-unknown-linux-gnu
upload-artifacts: true
test-workspace-build-2:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/dxt-lossless-transform
ref: d47afd9a7c2fa71495b6d942853b0fe41f258e26
path: test-project
- name: Test Workspace Build (CLI)
uses: ./
with:
rust-project-path: test-project/projects/dxt-lossless-transform-cli
workspace-path: "test-project"
crate-name: dxt-lossless-transform-cli
target: x86_64-unknown-linux-gnu
upload-artifacts: true
test-specific-nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v6
- name: Checkout Test Repository
uses: actions/checkout@v6
with:
repository: Sewer56/prs-rs
ref: 149060527e685360687d7332742ac016b39af8a7
path: test-project
- name: Test with Specific Nightly
uses: ./
with:
rust-project-path: test-project/tools/cli
crate-name: prs-rs-cli
target: x86_64-unknown-linux-gnu
rust-toolchain: nightly-2025-09-11
upload-artifacts: false