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

Add integration tests for C++ with clang & gcc #1677

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
104 changes: 101 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ jobs:
SCCACHE_EXE: ${{ github.workspace }}\\target\\x86_64-pc-windows-msvc\\debug\\sccache.exe
SCCACHE_LOG: "trace"
SCCACHE_ERROR_LOG: "${{ github.workspace }}\\server_log.txt"

steps:
- uses: ilammy/msvc-dev-cmd@v1

Expand All @@ -368,7 +368,7 @@ jobs:
shell: bash
working-directory: ./tests/msvc
run: cl "@args.rsp"

- name: Start Server
shell: bash
run: $SCCACHE_EXE --start-server
Expand All @@ -388,7 +388,7 @@ jobs:
$SCCACHE_EXE "$(where cl.exe)" -c "@args.rsp"
$SCCACHE_EXE --show-stats
$SCCACHE_EXE --show-stats | grep -e "Cache hits\s*[1-9]"

- name: Stop Server
if: success() || failure()
shell: bash
Expand All @@ -398,3 +398,101 @@ jobs:
if: success() || failure()
shell: bash
run: cat "$SCCACHE_ERROR_LOG"


clang:
runs-on: ubuntu-latest
needs: build

env:
LLVM_VERSION: "16"
SCCACHE_GHA_ENABLED: "on"

steps:
- uses: actions/checkout@v3

- name: Configure Cache Env
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh "${LLVM_VERSION}"

- uses: actions/download-artifact@v3
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Test
run: |
export CXX="${SCCACHE_PATH} clang++"
$CXX -c `pwd`/tests/test_clang_multicall.c

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: Test Twice for Cache Read
run: |
rm -f hello_world
export CXX="${SCCACHE_PATH} clang++"
$CXX -c `pwd`/tests/test_clang_multicall.c

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

gcc:
runs-on: ubuntu-latest
needs: build

env:
SCCACHE_GHA_ENABLED: "on"

steps:
- uses: actions/checkout@v3

- name: Configure Cache Env
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

- uses: actions/download-artifact@v3
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Test
run: |
export CXX="${SCCACHE_PATH} g++"
$CXX -c `pwd`/tests/test_clang_multicall.c

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: Test Twice for Cache Read
run: |
rm -f hello_world
export CXX="${SCCACHE_PATH} g++"
$CXX -c `pwd`/tests/test_clang_multicall.c

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"