Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
M. Fatih Cırıt committed Jun 25, 2024
1 parent f511e07 commit 6e6dbaa
Showing 1 changed file with 5 additions and 93 deletions.
98 changes: 5 additions & 93 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,20 @@ env:
CXX: /usr/lib/ccache/g++

jobs:
make-sure-label-is-present:
uses: autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1
with:
label: tag:run-build-and-test-differential

build-and-test-differential:
needs: make-sure-label-is-present
if: ${{ needs.make-sure-label-is-present.outputs.result == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rosdistro:
- humble
container-suffix:
- ""
- -cuda
include:
- rosdistro: humble
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
build-depends-repos: build_depends.repos
steps:
- name: Docker
run: |
docker pull ${{ matrix.container }}${{ matrix.container-suffix }}
docker run -it ${{ matrix.container }}${{ matrix.container-suffix }} /bin/bash
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"

Expand All @@ -49,88 +36,13 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}

# - name: Install sudo
# run: |
# if ! (command -v sudo >/dev/null 2>&1); then
# apt-get -y update
# apt-get -y install sudo
# fi
# shell: bash
#
# - name: Free Disk Space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# # this might remove tools that are actually needed,
# # if set to "true" but frees about 6 GB
# tool-cache: true
#
# # all of these default to true, but feel free to set to
# # "false" if necessary for your workflow
# android: true
# dotnet: true
# haskell: true
# large-packages: true
# docker-images: true
# swap-storage: false

- name: Show disk space before the tasks
run: df -h

- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1

- name: Get modified packages
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
- name: Show current dir
run: ls -alF

- name: Create ccache directory
- name: Docker
run: |
mkdir -p ${CCACHE_DIR}
du -sh ${CCACHE_DIR} && ccache -s
shell: bash

- name: Attempt to restore ccache
uses: actions/cache/restore@v4
with:
path: |
/root/.ccache
key: ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-${{ github.event.pull_request.base.sha }}
restore-keys: |
ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-
- name: Show ccache stats before build
run: du -sh ${CCACHE_DIR} && ccache -s
shell: bash

- name: Build
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
with:
rosdistro: ${{ matrix.rosdistro }}
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: ${{ matrix.build-depends-repos }}

- name: Show ccache stats after build
run: du -sh ${CCACHE_DIR} && ccache -s
shell: bash

- name: Test
id: test
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-test@v1
with:
rosdistro: ${{ matrix.rosdistro }}
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: ${{ matrix.build-depends-repos }}

- name: Upload coverage to CodeCov
if: ${{ steps.test.outputs.coverage-report-files != '' }}
uses: codecov/codecov-action@v4
with:
files: ${{ steps.test.outputs.coverage-report-files }}
fail_ci_if_error: false
verbose: true
flags: differential

- name: Show disk space after the tasks
run: df -h
docker pull ${{ matrix.container }}${{ matrix.container-suffix }}
docker run -it ${{ matrix.container }}${{ matrix.container-suffix }} /bin/bash

0 comments on commit 6e6dbaa

Please sign in to comment.