Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run ice2slice on CI #3377

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ice2slice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Run ice2slice

on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]

jobs:
ice2slice:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
use_ccache: false

- name: Build ice2slice
working-directory: ./cpp
run: make V=1 ice2slice

- name: Test ice2slice
working-directory: ./slice
run: |
# Run ice2slice on all .ice files in the slice directory
for dir in */; do ../cpp/bin/ice2slice -I. "$dir"/*.ice --output-dir $dir; done

while IFS= read -r file; do
# Derive the matching *.slice filename
base="${file%.ice}"
slice_file="${base}.slice"

# Check if the *.slice file exists
if [ ! -f "$slice_file" ]; then
echo "Error: No matching .slice file for $file"
exit 1
fi
done < <(find . -type f -name "*.ice")
4 changes: 4 additions & 0 deletions cpp/src/ice2slice/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ compile(const vector<string>& argv)
bool preprocess = opts.isSet("E");

string outputDir = opts.optArg("output-dir");
if (outputDir.empty())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was broken, not emitting any files when you don't specify the output dir. But the compiler din't give any errors, which seems odd.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that's a little weird. It just passes this into libSlice, so there could be something weird going on downstream.
I'll take a peek at it later.

{
outputDir = ".";
}

bool debug = opts.isSet("debug");

Expand Down
Loading