Remove utils #223
Workflow file for this run
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: Build And Test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
CFE_URL: "https://releases.llvm.org/5.0.2/cfe-5.0.2.src.tar.xz" | |
LLVM_SRC_URL: "https://releases.llvm.org/5.0.2/llvm-5.0.2.src.tar.xz" | |
MAKE_SRC_URL: "https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz" | |
RUSTUP_INIT_URL: "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init" | |
CMAKE_URL: "https://github.com/Kitware/CMake/releases/download/v3.28.0-rc5/cmake-3.28.0-rc5-linux-x86_64.tar.gz" | |
PUBLIC_SIMICS_PKGS_URL_WINDOWS: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/simics-6-packages-2024-05-win64.ispm" | |
PUBLIC_SIMICS_ISPM_URL_WINDOWS: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/intel-simics-package-manager-1.8.3-win64.exe" | |
PUBLIC_SIMICS_PKGS_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/simics-6-packages-2024-05-linux64.ispm" | |
PUBLIC_SIMICS_ISPM_URL: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/intel-simics-package-manager-1.8.3-linux64.tar.gz" | |
PUBLIC_SIMICS_PACKAGE_VERSION_1000: "6.0.185" | |
MINGW_URL: "https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0-16.0.6-11.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-13.2.0-llvm-16.0.6-mingw-w64ucrt-11.0.0-r1.7z" | |
MINGW_VERSION: "13.2.0-16.0.6-11.0.0-ucrt-r1" | |
jobs: | |
build_test_artifacts: | |
name: Build Test Artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add ISPM to PATH | |
run: | | |
echo "${HOME}/simics/ispm/" >> "${GITHUB_PATH}" | |
- name: Install Dependencies | |
run: | | |
sudo -E apt-get -y update && \ | |
sudo -E apt-get -y install \ | |
clang lld libclang-dev cmake curl dosfstools g++ gcc git llvm make \ | |
mtools ninja-build openssl libssl-dev python3 python3-pip | |
# NOTE: Tests only use the craff executable from the simics installation, so it can be | |
# skipped if there is a less heavyweight way to install craff | |
- name: Cache SIMICS Dependencies | |
id: cache-simics-packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/simics | |
key: simics-linux-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} | |
- name: Install SIMICS (External) | |
if: ${{ steps.cache-simics-packages.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p "${HOME}/simics/ispm/" && \ | |
curl -L -o "${HOME}/simics/ispm.tar.gz" \ | |
"${{ env.PUBLIC_SIMICS_ISPM_URL }}" && \ | |
curl -L -o "${HOME}/simics/simics.ispm" \ | |
"${{ env.PUBLIC_SIMICS_PKGS_URL }}" && \ | |
tar -C "${HOME}/simics/ispm" --strip-components=1 \ | |
-xvf "${HOME}/simics/ispm.tar.gz" | |
- name: Set up SIMICS Install Directory | |
run: | | |
ispm settings install-dir "${HOME}/simics" | |
- name: Install SIMICS Packages | |
if: ${{ steps.cache-simics-packages.outputs.cache-hit != 'true' }} | |
run: | | |
ispm packages --install-bundle "${HOME}/simics/simics.ispm" \ | |
--non-interactive --trust-insecure-packages | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Cache Test Artifacts | |
id: cache-test-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: tests/rsrc/ | |
key: cache-test-artifacts-${{ hashFiles('tests/rsrc/**/*') }} | |
- name: Build Test Artifacts | |
if: ${{ steps.cache-test-artifacts.outputs.cache-hit != 'true' }} | |
run: | | |
cd tests/rsrc/ | |
./build.sh | |
- name: Upload Test Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-artifacts | |
path: tests/rsrc/ | |
build_and_test: | |
name: Build and Test (Linux) | |
container: fedora:38 | |
runs-on: ubuntu-latest | |
needs: build_test_artifacts | |
steps: | |
- name: Add ISPM to PATH | |
run: | | |
echo "${HOME}/simics/ispm/" >> "${GITHUB_PATH}" | |
- name: Install Dependencies | |
run: | | |
dnf -y update && \ | |
dnf -y install \ | |
alsa-lib atk clang clang-libs clang-resource-filesystem \ | |
clang-tools-extra cmake cups curl dosfstools g++ gcc git \ | |
git-lfs glibc-devel glibc-devel.i686 glibc-static \ | |
glibc-static.i686 gtk3 lld lld-devel lld-libs llvm llvm-libs \ | |
llvm-static make mesa-libgbm mtools ninja-build openssl \ | |
openssl-devel openssl-libs python3 python3-pip yamllint | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Delete Un-Built Test Dependencies | |
run: | | |
rm -rf tests/rsrc/ | |
- name: Download Test Dependencies | |
uses: actions/download-artifact@v3 | |
with: | |
name: test-artifacts | |
path: tests/rsrc/ | |
- name: Take Ownership of Test Dependencies | |
run: | | |
ls -lahR tests/rsrc/ | |
chown -R "${USER}:${USER}" tests/rsrc/ | |
chmod -R 0755 tests/rsrc/ | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: nightly | |
components: rustfmt,clippy,miri | |
- name: Cache SIMICS Dependencies | |
id: cache-simics-packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/simics | |
key: simics-linux-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} | |
- name: Install SIMICS (External) | |
if: ${{ steps.cache-simics-packages.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p "${HOME}/simics/ispm/" && \ | |
curl -L -o "${HOME}/simics/ispm.tar.gz" \ | |
"${{ env.PUBLIC_SIMICS_ISPM_URL }}" && \ | |
curl -L -o "${HOME}/simics/simics.ispm" \ | |
"${{ env.PUBLIC_SIMICS_PKGS_URL }}" && \ | |
tar -C "${HOME}/simics/ispm" --strip-components=1 \ | |
-xvf "${HOME}/simics/ispm.tar.gz" | |
- name: Set up SIMICS Install Directory | |
run: | | |
ispm settings install-dir "${HOME}/simics" | |
- name: Install SIMICS Packages | |
if: ${{ steps.cache-simics-packages.outputs.cache-hit != 'true' }} | |
run: | | |
ispm packages --install-bundle "${HOME}/simics/simics.ispm" \ | |
--non-interactive --trust-insecure-packages | |
- name: Install SIMICS Build | |
run: | | |
cargo install --path simics-rs/cargo-simics-build | |
- name: Build TSFFS Package | |
run: | | |
SIMICS_BASE=${HOME}/simics/simics-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} cargo simics-build -r | |
- name: CT39 - Clippy Check Project | |
run: | | |
SIMICS_BASE=${HOME}/simics/simics-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} cargo clippy \ | |
|| ( echo "❗ [CT39 (1/2)] Failed clippy static analysis checks" && exit 1 ) | |
echo "✅ [CT39 (1/2)] Passed clippy static analysis checks" | |
- name: Test Project | |
run: | | |
SIMICS_TEST_LOCAL_PACKAGES_ONLY=1 SIMICS_BASE=${HOME}/simics/simics-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} cargo test -r -- --nocapture || ( echo "❗ Tests failed" && exit 1 ) | |
echo "✅ Tests passed" | |
- name: Build Docs | |
run: | | |
SIMICS_BASE=${HOME}/simics/simics-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} cargo doc --workspace --no-deps | |
- name: Test Docs | |
run: | | |
SIMICS_BASE=${HOME}/simics/simics-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} cargo test --doc | |
build_windows: | |
name: Build and Test (Windows) | |
runs-on: windows-latest | |
steps: | |
- name: Add ISPM and MinGW to PATH | |
run: | | |
set PATH $env:PATH | |
"C:\MinGW\bin" | Out-File -FilePath $env:GITHUB_PATH | |
"C:\ISPM\" | Out-File -FilePath $env:GITHUB_PATH -Append | |
"$PATH" | Out-File -FilePath $env:GITHUB_PATH -Append | |
echo "Current PATH: " $env:GITHUB_PATH | |
- name: Cache MinGW | |
id: cache-mingw | |
uses: actions/cache@v3 | |
with: | |
path: C:\MinGW\ | |
key: mingw-${{ env.MINGW_VERSION }} | |
- name: Download and Extract MinGW-w64 | |
if: ${{ steps.cache-mingw.outputs.cache-hit != 'true' }} | |
run: | | |
Invoke-WebRequest -URI ${{ env.MINGW_URL }} -OutFile mingw.7z | |
7z x mingw.7z -oC:\mingw-w64\ | |
mv C:\mingw-w64\mingw64\ C:\MinGW\ | |
- name: Download and Install Rust | |
run: | | |
Invoke-WebRequest -URI https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe | |
C:\rustup-init.exe --default-toolchain nightly --default-host x86_64-pc-windows-gnu -y | |
- name: Cache SIMICS | |
id: cache-simics-packages-windows | |
uses: actions/cache@v3 | |
with: | |
path: | | |
C:\ISPM\ | |
C:\SIMICS\ | |
key: simics-windows-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }} | |
# ispm-installer.exe is a NSIS installer for the elctron build. We want the | |
# default options, so we pass /S to install silently: | |
# https://nsis.sourceforge.io/Docs/Chapter3.html#installerusage | |
# | |
# NOTE: We use | Out-Null on the installer command to make powershell wait for it | |
# to actually finish instead of forking it to the background | |
- name: Download and Install ISPM | |
if: ${{ steps.cache-simics-packages-windows.outputs.cache-hit != 'true' }} | |
run: | | |
Invoke-WebRequest -URI ${{ env.PUBLIC_SIMICS_ISPM_URL_WINDOWS }} -OutFile C:\ispm-installer.exe | |
C:\ispm-installer.exe /S /D='C:\ISPM\' | Out-Null | |
- name: Set SIMICS Install Directory | |
run: | | |
ispm.exe settings install-dir C:\SIMICS\ | |
- name: Download and Install SIMICS Packages | |
if: ${{ steps.cache-simics-packages-windows.outputs.cache-hit != 'true' }} | |
run: | | |
Invoke-WebRequest -URI ${{ env.PUBLIC_SIMICS_PKGS_URL_WINDOWS }} -OutFile C:\simics-6-packages.ispm | |
ispm.exe packages --install-bundle C:\simics-6-packages.ispm --non-interactive --trust-insecure-packages | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Setup, Build, and Install TSFFS | |
run: | | |
cargo install --path simics-rs/cargo-simics-build | |
cargo simics-build -r | |
- name: Upload Distribution Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: simics-pkg-31337-win64 | |
path: target/release/simics-pkg-31337-*-win64.ispm | |
build_dist: | |
name: Build for Distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Cache Builder Dependencies | |
id: cache-builder-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .github/builder/rsrc | |
key: "cache-builder-dependencies-${{ env.PUBLIC_SIMICS_ISPM_URL}}-${{env.PUBLIC_SIMICS_PKGS_URL }}" | |
- name: Download Builder Dependencies | |
if: ${{ steps.cache-builder-dependencies.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p .github/builder/rsrc | |
curl -L -o .github/builder/rsrc/ispm.tar.gz \ | |
"${{ env.PUBLIC_SIMICS_ISPM_URL }}" && \ | |
curl -L -o .github/builder/rsrc/simics.ispm \ | |
"${{ env.PUBLIC_SIMICS_PKGS_URL }}" | |
curl -L -o .github/builder/rsrc/cfe-5.0.2.src.tar.xz \ | |
"${{ env.CFE_URL }}" | |
curl -L -o .github/builder/rsrc/llvm-5.0.2.src.tar.xz \ | |
"${{ env.LLVM_SRC_URL }}" | |
curl -L -o .github/builder/rsrc/make-4.4.1.tar.gz \ | |
"${{ env.MAKE_SRC_URL }}" | |
curl -L -o .github/builder/rsrc/rustup-init \ | |
"${RUSTUP_INIT_URL}" | |
chmod +x .github/builder/rsrc/rustup-init | |
curl -L -o .github/builder/rsrc/cmake-3.28.0-rc5-linux-x86_64.tar.gz \ | |
"${CMAKE_URL}" | |
- name: Build Distribution Package | |
run: | | |
docker build -t tsffs-dist -f .github/builder/Dockerfile . | |
docker create --name tsffs-dist tsffs-dist bash | |
docker cp tsffs-dist:/tsffs/linux64/packages/ packages/ | |
docker rm -f tsffs-dist | |
- name: Upload Distribution Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: simics-pkg-31337-linux64 | |
path: packages/simics-pkg-31337-*-linux64.ispm |