Skip to content

Commit

Permalink
Merge pull request #2 from Aurelius84/develop
Browse files Browse the repository at this point in the history
[CI]Add CI task for athena base on Github Action
  • Loading branch information
Aurelius84 authored Jul 12, 2024
2 parents 47005b4 + 8fd3d1c commit bd8b3cd
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflow/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Package

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
# For the sake of simplicity in testing, the Athena packaging program will temporarily run on Ubuntu-latest.
# However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future.
runs-on: ubuntu-latest

# For the sake of simplicity in testing, the Athena packaging program will temporarily only package executable files for Python 3.8.
# In the future, we will need to extend support to cover Python 3.8 through Python 3.12.
steps:
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'

# Checkout the latest branch of Athena.
- name: Checkout Athena
uses: actions/checkout@v4
with:
submodules: true
path: athena


# Install Dependencies for Python
- name: Install Dependencies for Python
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
# Build Athena
- name: Build Athena
working-directory: ./athena
run: |
python -m build
python -m pip install dist/*.whl
# Install Test
- name: Run Test
working-directory: ./athena/tests
run: |
bash run_all_test.sh
29 changes: 29 additions & 0 deletions tests/run_all_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

failed_scripts=()
whitelist=(
# "tests/test-generate-fusion-op-unittests.sh"
)

for script in tests/test-generate*.sh; do
if [[ " ${whitelist[@]} " =~ " ${script} " ]]; then
output=$(bash "$script" 2>&1)
status=$?
if [ $status -ne 0 ]; then
failed_scripts+=("$script: $output")
fi
else
echo "Skip $script"
fi
done

if [ ${#failed_scripts[@]} -gt 0 ]; then
echo "The following tests failed: "
for script in "${failed_scripts[@]}"; do
echo "$script"
done
echo "Failed!"
exit 1
else
echo "All tests run successfully!"
fi

0 comments on commit bd8b3cd

Please sign in to comment.