ci: use symbiflow/actions/checks@main Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
diff --git a/.github/ci/check_license.sh b/.github/ci/check_license.sh deleted file mode 100755 index 45f5e3b..0000000 --- a/.github/ci/check_license.sh +++ /dev/null
@@ -1,76 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2020 The SymbiFlow Authors. -# -# Use of this source code is governed by a ISC-style -# license that can be found in the LICENSE file or at -# https://opensource.org/licenses/ISC -# -# SPDX-License-Identifier: ISC - -set -e - -echo -echo "===========================" -echo "Check SPDX identifier" -echo "===========================" -echo - -ERROR_FILES="" -FILES_TO_CHECK=`find . \ - -type f \( -name '*.sh' -o -name '*.py' -o -name 'Makefile' -o -name '*.v' \) \ - \( -not -path "*/.*/*" \) \ - \( -not -path "*/build/*" \) \ - \( -not -path "*/env/*" \) \ - \( -not -path "*/src/*" \) \ - \( -not -path "*/third_party/*" \) \ - \( -not -path "*/*/__init__.py" \) \ - \( -not -path "./miniconda.sh" \) | sort` - -for file in $FILES_TO_CHECK; do - echo "Checking $file" - grep -q "SPDX-License-Identifier" $file || ERROR_FILES="$ERROR_FILES $file" -done - -if [ ! -z "$ERROR_FILES" ]; then - for file in $ERROR_FILES; do - echo "ERROR: $file does not have license information." - done - exit 1 -fi - -THIRD_PARTY_DIRS=$(shopt -s nullglob; echo third_party/*) -ERROR_NO_LICENSE="" - -if [ -z "$THIRD_PARTY_DIRS" ]; then - exit 0 -fi - -echo -echo "===========================" -echo "Check third party LICENSE" -echo "===========================" -echo - -function check_if_submodule { - for submodule in `git submodule --quiet foreach 'echo $sm_path'`; do - if [ "$1" == "$submodule" ]; then - return 1 - fi - done -} - -for dir in $THIRD_PARTY_DIRS; do - # Checks if we are not in a submodule - if check_if_submodule $dir; then - echo "Checking $dir" - [ -f $dir/LICENSE ] || ERROR_NO_LICENSE="$ERROR_NO_LICENSE $dir" - fi -done - -if [ ! -z "$ERROR_NO_LICENSE" ]; then - for dir in $ERROR_NO_LICENSE; do - echo "ERROR: $dir does not have the LICENSE file." - done - exit 1 -fi
diff --git a/.github/ci/check_python_script.sh b/.github/ci/check_python_script.sh deleted file mode 100755 index ff5e3ac..0000000 --- a/.github/ci/check_python_script.sh +++ /dev/null
@@ -1,51 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2020 The SymbiFlow Authors. -# -# Use of this source code is governed by a ISC-style -# license that can be found in the LICENSE file or at -# https://opensource.org/licenses/ISC -# -# SPDX-License-Identifier: ISC - -set -e - -echo -echo "===================================" -echo "Check python utf coding and shebang" -echo "===================================" -echo - -ERROR_FILES_SHEBANG="" -ERROR_FILES_UTF_CODING="" -FILES_TO_CHECK=`find . \ - -type f \( -name '*.py' \) \ - \( -not -path "*/.*/*" \) \ - \( -not -path "*/build/*" \) \ - \( -not -path "*/env/*" \) \ - \( -not -path "*/src/*" \) \ - \( -not -path "*/third_party/*" \) \ - \( -not -path "*/*/__init__.py" \) \ - \( -not -path "./miniconda.sh" \) | sort` - -for file in $FILES_TO_CHECK; do - echo "Checking $file" - grep -q "\#\!/usr/bin/env python3" $file || ERROR_FILES_SHEBANG="$ERROR_FILES_SHEBANG $file" - grep -q "\#.*coding: utf-8" $file || ERROR_FILES_UTF_CODING="$ERROR_FILES_UTF_CODING $file" -done - -if [ ! -z "$ERROR_FILES_SHEBANG" ]; then - for file in $ERROR_FILES_SHEBANG; do - echo "ERROR: $file does not have the python3 shebang." - done -fi - -if [ ! -z "$ERROR_FILES_UTF_CODING" ]; then - for file in $ERROR_FILES_UTF_CODING; do - echo "ERROR: $file does not have the utf encoding set." - done -fi -echo -if [ ! -z "${ERROR_FILES_SHEBANG}${ERROR_FILES_UTF_CODING}" ]; then - exit 1 -fi
diff --git a/.github/ci/test.sh b/.github/test.sh similarity index 100% rename from .github/ci/test.sh rename to .github/test.sh
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95060bb..1f4991f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml
@@ -3,21 +3,21 @@ on: [push, pull_request] jobs: + + Checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Licenses - run: ./.github/ci/check_license.sh - - name: Python Script Headers - run: ./.github/ci/check_python_script.sh + + - uses: symbiflow/actions/checks@main + Tests: runs-on: ubuntu-latest strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] - steps: - uses: actions/checkout@v2 @@ -30,10 +30,11 @@ - name: Test run: | - TOXENV="$(echo py${{ matrix.python-version }} | sed -e's/\.//g')" .github/ci/test.sh + TOXENV="$(echo py${{ matrix.python-version }} | sed -e's/\.//g')" .github/test.sh + - name: Upload test results uses: actions/upload-artifact@v2 with: name: test-results-${{ matrix.python-version }} path: junit/python${{ matrix.python-version }}-test-results.xml - if: ${{ always() }} + if: always()