diff --git a/.github/actions/build-mips/action.yaml b/.github/actions/build-mips/action.yaml new file mode 100644 index 0000000000..26dda82f20 --- /dev/null +++ b/.github/actions/build-mips/action.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml index 8da92c5de5..3d4434b538 100644 --- a/.github/workflows/ci-nightly.yml +++ b/.github/workflows/ci-nightly.yml @@ -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) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09b91f2ab9..97502dd7a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/.github/workflows/o1vm-mips-ci.yml b/.github/workflows/o1vm-mips-ci.yml deleted file mode 100644 index 83b52a055a..0000000000 --- a/.github/workflows/o1vm-mips-ci.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: ov1m CI - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - -jobs: - build_test_package: - name: Build, test, and package simple MIPS programs - runs-on: ubuntu-latest - strategy: - matrix: - rust_toolchain_version: ["1.74"] - - steps: - - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Cache apt packages - id: apt-cache - uses: actions/cache@v4 - with: - path: | - /var/cache/apt/archives/*.deb - key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/mips-build.yml') }} - - - name: Install MIPS tools - run: | - sudo apt-get update - sudo apt-get install -y binutils-mips-linux-gnu - - - name: Build MIPS programs - run: make build-mips-programs - - - name: Use shared Rust toolchain setting up steps - uses: ./.github/actions/toolchain-shared - with: - rust_toolchain_version: ${{ matrix.rust_toolchain_version }} - - - name: Test interpreter against mips programs - run: | - cargo test --features open_mips --test test_mips_elf -- --nocapture - - - 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 \ No newline at end of file diff --git a/.github/workflows/o1vm-upload-mips-build.yml b/.github/workflows/o1vm-upload-mips-build.yml new file mode 100644 index 0000000000..72e3e77cb6 --- /dev/null +++ b/.github/workflows/o1vm-upload-mips-build.yml @@ -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 \ No newline at end of file