Nightly build #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly build | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
check_changes: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
outputs: | |
should_run: ${{steps.should_run.outputs.should_run}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: print latest_commit | |
run: echo ${{github.sha}} | |
- id: should_run | |
continue-on-error: true | |
name: check latest commit is less than a day | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{github.sha}}) && echo "::set-output name=should_run::false" | |
optimize: | |
name: PGO Build | |
strategy: | |
matrix: | |
os: [ | |
{ os: ubuntu-latest, arch: x86_64-unknown-linux-gnu }, | |
{ os: macos-latest, arch: aarch64-apple-darwin }, | |
{ os: windows-latest, arch: x86_64-pc-windows-msvc } | |
] | |
needs: check_changes | |
if: ${{needs.check_changes.outputs.should_run != 'false'}} | |
runs-on: ${{ matrix.os.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
components: llvm-tools-preview | |
- name: Set the STEEL_HOME environment variable | |
run: echo STEEL_HOME=${PWD}/.steel-sync >> $GITHUB_ENV | |
- name: Install cargo-pgo | |
run: cargo install cargo-pgo | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "build" | |
- name: Build instrumented binary | |
# Use `cargo pgo build -- --bin foo` if you have multiple binaries | |
run: cargo pgo build | |
- name: install steel dylib installer | |
env: | |
STEEL_HOME: ${{ env.STEEL_HOME }} | |
run: mkdir -p $STEEL_HOME/native && cd crates/cargo-steel-lib && cargo install --path . | |
- name: Install cogs | |
env: | |
STEEL_HOME: ${{ env.STEEL_HOME }} | |
run: | | |
echo $STEEL_HOME | |
mkdir -p .steel/cogs | |
cd cogs/ | |
cargo run -- install.scm | |
- name: Gather PGO profiles | |
env: | |
STEEL_HOME: ${{ env.STEEL_HOME }} | |
run: | | |
./target/${{ matrix.os.arch }}/release/steel r7rs-benchmarks/scheme.scm | |
./target/${{ matrix.os.arch }}/release/steel r7rs-benchmarks/simplex.scm | |
./target/${{ matrix.os.arch }}/release/steel r7rs-benchmarks/array1.scm | |
./target/${{ matrix.os.arch }}/release/steel r7rs-benchmarks/triangl.scm | |
./target/${{ matrix.os.arch }}/release/steel benchmarks/fib/fib.scm | |
- name: Build optimized binary | |
run: cargo pgo optimize | |
- name: Archive pgo optimized binary | |
if: ${{ runner.os != 'windows' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pgo-nightly-build-${{ matrix.os.arch }} | |
path: ${{ github.workspace }}/target/${{ matrix.os.arch }}/release/steel | |
retention-days: 30 | |
- name: Archive pgo optimized binary (windows) | |
if: ${{ runner.os == 'windows' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pgo-nightly-build-${{ matrix.os.arch }} | |
path: target\${{ matrix.os.arch }}\release\steel.exe | |
retention-days: 30 | |