Skip to content

ci: move scripts from '.github/gha' and '.github/travis' into '.github/scripts' #1804

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

Merged
merged 3 commits into from
Jul 30, 2021
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
1 change: 0 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ docs:
- tutorial
- "*.rst"
infra:
- "*travis*"
- .github/*
- .github/**/*
- Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion .github/travis/build.sh → .github/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

source .github/travis/common.sh
set -e

source $(dirname "$0")/common.sh

$SPACER

start_section "vtr.build" "${GREEN}Building..${NC}"
Expand Down
5 changes: 0 additions & 5 deletions .github/travis/common.sh → .github/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ NC='\033[0m' # No Color

SPACER="echo -e ${GRAY} - ${NC}"

travis_nanoseconds() { true; }
travis_fold() { true; }
travis_time_start() { true; }
travis_time_finish() { true; }

function start_section() {
echo -e "${PURPLE}Verilog To Routing${NC}: - $2${NC}"
echo -e "${GRAY}-------------------------------------------------------------------${NC}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

source .github/travis/common.sh
set -e

source $(dirname "$0")/common.sh

$SPACER

if [ "_${_COVERITY_EMAIL}" == "_" ] ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ sudo apt install -y \
clang-7 \
clang-10
# libtbb-dev

pip install -r requirements.txt
5 changes: 4 additions & 1 deletion .github/travis/unittest.sh → .github/scripts/unittest.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

source .github/travis/common.sh
set -e

source $(dirname "$0")/common.sh

$(dirname "$0")/build.sh

$SPACER

start_section "vtr.test.0" "${GREEN}Testing..${NC} ${CYAN}C++ unit tests${NC}"
Expand Down
80 changes: 28 additions & 52 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ jobs:
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
BUILD_TYPE: release
run: |
source .github/travis/common.sh
./.github/travis/build.sh
run: ./.github/scripts/build.sh


Format:
Expand All @@ -46,60 +43,50 @@ jobs:
name: 'F: ${{ matrix.name }}'
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
run: |
source .github/travis/common.sh
./dev/${{ matrix.script }}
run: ./dev/${{ matrix.script }}


UniTests:
name: 'U: C++ Unit Tests'
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
CMAKE_PARAMS: "-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on"
run: |
source .github/travis/common.sh
./.github/travis/build.sh
./.github/travis/unittest.sh
run: ./.github/scripts/unittest.sh


Warnings:
name: 'W: Check Compilation Warnings'
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
#In order to get compilation warnings produced per source file, we must do a non-IPO build
#We also turn warnings into errors for this target by doing a strict compile
CMAKE_PARAMS: "-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_STRICT_COMPILE=on -DVTR_IPO_BUILD=off"
run: |
source .github/travis/common.sh
./.github/travis/build.sh
run: ./.github/scripts/build.sh


Regression:
Expand Down Expand Up @@ -137,19 +124,17 @@ jobs:
name: 'R: ${{ matrix.name }}'
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
CMAKE_PARAMS: ${{ matrix.params }}
run: |
source .github/travis/common.sh
./.github/travis/build.sh
./.github/scripts/build.sh
./run_reg_test.py ${{ matrix.suite }} -show_failures -j2


Expand All @@ -164,43 +149,40 @@ jobs:
name: 'S: ${{ matrix.name }}'
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
CMAKE_PARAMS: '-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=on -DVTR_IPO_BUILD=off -DWITH_BLIFEXPLORER=on'
BUILD_TYPE: debug
LSAN_OPTIONS: 'exitcode=42' #Use a non-standard exit code to ensure LSAN errors are detected
run: |
source .github/travis/common.sh
./.github/travis/build.sh
./.github/scripts/build.sh
# We skip QoR since we are only checking for errors in sanitizer runs
./run_reg_test.py ${{ matrix.suite }} -show_failures -j2 -skip_qor


ODINII:
name: 'ODIN-II Basic Tests'
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
CMAKE_PARAMS: '-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=on -DVTR_IPO_BUILD=off -DWITH_BLIFEXPLORER=on'
BUILD_TYPE: debug
run: |
source .github/travis/common.sh
./.github/travis/build.sh
./.github/scripts/build.sh
./run_reg_test.py odin_reg_basic -show_failures -j2


Expand All @@ -221,21 +203,18 @@ jobs:
name: 'B: ${{ matrix.name }}'
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
CMAKE_PARAMS: "-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on"
MATRIX_EVAL: ${{ matrix.eval }}
BUILD_TYPE: ${{ matrix.build }}
run: |
source .github/travis/common.sh
./.github/travis/build.sh
run: ./.github/scripts/build.sh


Coverity:
Expand All @@ -252,18 +231,15 @@ jobs:
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- uses: actions/checkout@v2
- run: ./.github/scripts/install_dependencies.sh

- name: Test
env:
CMAKE_PARAMS: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on'
_COVERITY_URL: 'https://scan.coverity.com/download/linux64'
_COVERITY_MD5: 'd0d7d7df9d6609e578f85096a755fb8f'
run: |
source .github/travis/common.sh
./.github/travis/build.sh
run: ./.github/scripts/build.sh
2 changes: 2 additions & 0 deletions dev/check-format-py.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

source $(dirname "$0")/../.github/scripts/common.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the goal was to keep these scripts from depending on stuff under the .github directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. That's what I thought. However, the common.sh is currently explicitly sourced. See

Format:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
include:
- { name: 'C/C++', script: 'check-format.sh' }
- { name: 'Python', script: 'check-format-py.sh' }
- { name: 'Python Lint', script: 'pylint_check.py' }
name: 'F: ${{ matrix.name }}'
steps:
- uses: actions/checkout@v2
- run: ./.github/gha/install_dependencies.sh
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install -r requirements.txt
- name: Test
run: |
source .github/travis/common.sh
./dev/${{ matrix.script }}

I tried to do minimal functional modifications in this PR. So, precisely, I preserved common to be sourced before/in check-format.sh and check-formar-py.sh, but I did not in pylint_check.py.

If you or any maintainer/developer can confirm that common.sh is not required in check-format.sh/check-formar-py.sh, I will update them.

Moreover, the git blame belongs to me. So, this is inherited from the previous .travis.yml file. There, the common script was source in all the jobs: 13a8c9f#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485L243-L254


clean=$(git status -s -uno | wc -l) #Short ignore untracked

if [ $clean -ne 0 ]; then
Expand Down
2 changes: 2 additions & 0 deletions dev/check-format.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

source $(dirname "$0")/../.github/scripts/common.sh

clean=$(git status -s -uno | wc -l) #Short ignore untracked

if [ $clean -ne 0 ]; then
Expand Down