Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Update compile-test.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Eason Lu <[email protected]>
  • Loading branch information
aelnosu authored Sep 12, 2023
1 parent 3f35f42 commit 788e1f5
Showing 1 changed file with 43 additions and 28 deletions.
71 changes: 43 additions & 28 deletions .github/workflows/compile-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,50 @@ jobs:
sudo apt install -y clang
sudo apt install -y llvm
- name: Compile C++ code (C++03)
- name: Compile C++ code
run: |
g++ -std=c++03 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc03 || true
clang++ -std=c++03 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang03 || true
- name: Compile C++ code (C++11)
run: |
g++ -std=c++11 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc11 || true
clang++ -std=c++11 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang11 || true
- name: Compile C++ code (C++14)
run: |
g++ -std=c++14 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc14 || true
clang++ -std=c++14 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang14 || true
- name: Compile C++ code (C++17)
run: |
g++ -std=c++17 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc17 || true
clang++ -std=c++17 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang17 || true
- name: Compile C++ code (C++20)
run: |
g++ -std=c++20 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc20 || true
clang++ -std=c++20 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang20 || true
- name: Compile C++ code (C++23)
run: |
g++ -std=c++23 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc23 || true
clang++ -std=c++2b -Wall -Wextra -Werror -pedantic -c password.cpp -o clang23 || true
success=false
# Compile with different C++ standards
if g++ -std=c++03 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc03; then
success=true
fi
if g++ -std=c++11 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc11; then
success=true
fi
if g++ -std=c++14 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc14; then
success=true
fi
if g++ -std=c++17 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc17; then
success=true
fi
if g++ -std=c++20 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc20; then
success=true
fi
if g++ -std=c++23 -Wall -Wextra -Werror -pedantic -c password.cpp -o gcc23; then
success=true
fi
if clang++ -std=c++03 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang03; then
success=true
fi
if clang++ -std=c++11 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang11; then
success=true
fi
if clang++ -std=c++14 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang14; then
success=true
fi
if clang++ -std=c++17 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang17; then
success=true
fi
if clang++ -std=c++20 -Wall -Wextra -Werror -pedantic -c password.cpp -o clang20; then
success=true
fi
if clang++ -std=c++2b -Wall -Wextra -Werror -pedantic -c password.cpp -o clang23; then
success=true
fi
# Exit with a non-zero status if none of the compilations succeeded
if ! $success; then
exit 1
fi
- name: Upload build artifact
if: always()
Expand Down

0 comments on commit 788e1f5

Please sign in to comment.