reordered exampels #55
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: Testing Suite | |
on: | |
push: | |
branches: [ main, dev, ci_testing, experiments ] | |
pull_request: | |
branches: [ main, dev ] | |
env: | |
llvm_version: 18 | |
jobs: | |
build-c3fzf: | |
runs-on: ubuntu-22.04 | |
strategy: | |
# Don't abort runners if a single one fails | |
fail-fast: false | |
matrix: | |
optimize: ["O0", "O5"] | |
steps: | |
- name: Checkout c3tools | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/c3c_build_latest | |
name: Build c3c compiler | |
- name: c3tools unit tests | |
run: | | |
c3c -${{ matrix.optimize }} --trust=full test | |
- name: c3fzf on c3tools | |
run: | | |
c3c --trust=full -${{ matrix.optimize }} build c3fzf | |
./build/c3fzf --project=./lib/ . | |
./build/c3fzf --project=./lib/ . . | |
./build/c3fzf --project=./lib/ c3tools::codefmt . | |
- name: c3fzf preview | |
run: | | |
./build/c3fzf --project=./lib/ --preview c3tools::codefmt CodeFmt | |
- name: c3fzf stdlib | |
run: | | |
./build/c3fzf --stdlib=./c3c/lib/std --project=./lib/ . | |
./build/c3fzf --stdlib=./c3c/lib/std --project=./lib/ . . | |
- name: c3fzf stdlib symbols | |
run: | | |
./build/c3fzf --stdlib=./c3c/lib/std --project=./lib/ std::core::string . | |
- name: c3fzf stdlib preview | |
run: | | |
./build/c3fzf --preview --stdlib=./c3c/lib/std --project=./lib/ std::core::string . | |
- name: c3fzf stdlib preview full stdlib | |
run: | | |
./build/c3fzf --project=./lib/ --stdlib=./c3c/lib/std . | xargs -I{} ./build/c3fzf --project=./lib/ --preview --stdlib=./c3c/lib/std {} . | |
build-c3fmt: | |
runs-on: ubuntu-22.04 | |
strategy: | |
# Don't abort runners if a single one fails | |
fail-fast: false | |
matrix: | |
line_width: [80, 100] | |
indent: ["4", "t"] | |
optimize: ["O0", "O5"] | |
steps: | |
- name: Checkout c3tools | |
uses: actions/checkout@v4 | |
- name: Build c3c compiler | |
uses: ./.github/actions/c3c_build_latest | |
# | |
# c3tools self formatting block | |
# | |
- name: c3tools unit tests | |
run: | | |
if [[ "${{matrix.optimize}}" == "O0" ]]; then | |
c3c --sanitize=address --trust=full build c3fmt | |
c3c --sanitize=address --trust=full test | |
else | |
c3c -${{ matrix.optimize }} --trust=full test | |
c3c -${{ matrix.optimize }} --trust=full build c3fmt | |
fi | |
- name: c3fmt c3tools | |
run: | | |
find lib/ | grep ".c3$" | xargs -I{} ./build/c3fmt -w ${{ matrix.line_width }} -i ${{ matrix.indent }} {} | |
- name: c3tools unit tests after formatting | |
run: | | |
c3c --trust=full test | |
- name: c3fmt c3tools (double) | |
run: | | |
find lib/ | grep ".c3$" | xargs -I{} ./build/c3fmt -w ${{ matrix.line_width }} -i ${{ matrix.indent }} {} | |
- name: c3tools unit tests after (double) formatting | |
run: | | |
c3c --trust=full test | |
# | |
# c3c formatting block | |
# | |
- name: c3c compiler tests (original) | |
run: | | |
cd c3c/test | |
python3 src/tester.py ../build/c3c test_suite/ | |
- name: c3fmt stdlib | |
run: | | |
find c3c/lib/ | grep ".c3$" | xargs -I{} ./build/c3fmt -w ${{ matrix.line_width }} -i ${{ matrix.indent }} {} | |
cd c3c/ | |
echo "Checking if any changes in files" | |
git add . && git diff --quiet && git diff --cached | head | |
git commit -m "CI commit after formatting" | |
- name: c3c stdlib unit tests formatted | |
run: | | |
cd c3c/test | |
../build/c3c compile-test unit | |
- name: c3fmt stdlib (double) | |
run: | | |
find c3c/lib/ | grep ".c3$" | xargs -I{} ./build/c3fmt -w ${{ matrix.line_width }} -i ${{ matrix.indent }} {} | |
cd c3c/ | |
echo "Checking if any changes after formatting (must be the same!)" | |
git diff | head | |
git diff --quiet | |
- name: c3c stdlib unit tests formatted (double) | |
run: | | |
cd c3c/test | |
../build/c3c compile-test unit | |
- name: c3fmt c3c/test/unit | |
run: | | |
find c3c/test/unit | grep ".c3$" | xargs -I{} ./build/c3fmt -w ${{ matrix.line_width }} -i ${{ matrix.indent }} {} | |
- name: c3c unit tests on formatted c3c/test/unit | |
run: | | |
cd c3c/test | |
../build/c3c compile-test unit | |
- name: c3fmt of all *.c3t files in test_suite | |
run: | | |
./scripts/c3fmt_c3c_test_suite.sh c3c/test/test_suite/ |