Skip to content

Commit

Permalink
make mips build an action so can be reused
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall committed Jan 7, 2025
1 parent a7f71e2 commit 4fa1f26
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 57 deletions.
22 changes: 22 additions & 0 deletions .github/actions/build-mips/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Build MIPS Programs'
description: 'Builds MIPS programs for testing'

runs:
using: "composite"
steps:
- name: Cache apt packages
uses: actions/cache@v4
with:
path: |
/var/cache/apt/archives/*.deb
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/o1vm-mips-build.yml') }}

- name: Install MIPS tools
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y binutils-mips-linux-gnu
- name: Build MIPS programs
shell: bash
run: make build-mips-programs
3 changes: 3 additions & 0 deletions .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
run: |
make install-test-deps
- name: Build the MIPS binaries
uses: ./.github/actions/build-mips

- name: Run all tests with the code coverage
run: |
eval $(opam env)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ jobs:
run: |
make install-test-deps
- name: Build the MIPS binaries
uses: ./.github/actions/build-mips

- name: Doc tests
if: ${{ matrix.rust_toolchain_version != env.RUST_TOOLCHAIN_COVERAGE_VERSION }}
run: |
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/o1vm-mips-ci.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/o1vm-upload-mips-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload MIPS Binaries

on:
workflow_dispatch:

jobs:
build_and_upload:
name: Build and Upload MIPS Programs
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build MIPS binaries
uses: ./.github/actions/build-mips

- name: Create tar archive
run: |
cd o1vm/resources/programs/mips
tar -czf mips-binaries.tar.gz bin/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: mips-binaries
path: o1vm/resources/programs/mips/mips-binaries.tar.gz

0 comments on commit 4fa1f26

Please sign in to comment.