travis to github workflow migration

This commit is contained in:
Blaise Tine 2024-07-20 01:14:54 -07:00
parent aac57a5f81
commit 3eaa6e4e55
2 changed files with 126 additions and 102 deletions

126
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,126 @@
# Copyright 2024 blaise
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI
on: [push, pull_request]
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential valgrind libstdc++6 binutils python uuid-dev
- name: Cache Toolchain Directory
id: cache-toolchain
uses: actions/cache@v2
with:
path: $HOME/tools
key: ${{ runner.os }}-toolchain-v0.4
restore-keys: |
${{ runner.os }}-toolchain-
- name: Cache Third Party Directory
id: cache-thirdparty
uses: actions/cache@v2
with:
path: $HOME/third_party
key: ${{ runner.os }}-thirdparty-v0.2
restore-keys: |
${{ runner.os }}-thirdparty-
- name: Setup Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
TOOLDIR=$HOME/tools
rm -rf $TOOLDIR
mkdir -p $GITHUB_WORKSPACE/build && cd $GITHUB_WORKSPACE/build
../configure --tooldir=$TOOLDIR
ci/toolchain_install.sh --all
echo "v0.4" > "$TOOLDIR/version.txt"
- name: Setup Third Party
if: steps.cache-thirdparty.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE
make -C third_party > /dev/null
echo "v0.2" > "third_party/version.txt"
cp -rf third_party $HOME
build:
runs-on: ubuntu-20.04
needs: setup
strategy:
matrix:
xlen: [32, 64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Build Environment
run: |
TOOLDIR=$HOME/tools
mkdir -p $GITHUB_WORKSPACE/build${{ matrix.xlen }}
cd $GITHUB_WORKSPACE/build${{ matrix.xlen }}
../configure --tooldir=$TOOLDIR --xlen=${{ matrix.xlen }}
source ci/toolchain_env.sh
make build -s > /dev/null
tests:
runs-on: ubuntu-20.04
needs: build
strategy:
matrix:
name: [regression32, regression64, config, debug]
xlen: [32, 64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup build environment
run: |
cd $GITHUB_WORKSPACE/build${{ matrix.xlen }}
source ci/toolchain_env.sh
- name: Run tests
run: |
TOOLDIR=$HOME/tools
if [ "${{ matrix.name }}" == "regression32" ]; then
./ci/travis_run.py ./ci/regression.sh --unittest
./ci/travis_run.py ./ci/regression.sh --isa
./ci/travis_run.py ./ci/regression.sh --kernel
./ci/travis_run.py ./ci/regression.sh --synthesis
./ci/travis_run.py ./ci/regression.sh --regression
./ci/travis_run.py ./ci/regression.sh --opencl
elif [ "${{ matrix.name }}" == "regression64" ]; then
./ci/travis_run.py ./ci/regression.sh --isa
./ci/travis_run.py ./ci/regression.sh --kernel
./ci/travis_run.py ./ci/regression.sh --synthesis
./ci/travis_run.py ./ci/regression.sh --regression
./ci/travis_run.py ./ci/regression.sh --opencl
elif [ "${{ matrix.name }}" == "config" ]; then
./ci/travis_run.py ./ci/regression.sh --cluster
./ci/travis_run.py ./ci/regression.sh --config
elif [ "${{ matrix.name }}" == "debug" ]; then
./ci/travis_run.py ./ci/regression.sh --debug
./ci/travis_run.py ./ci/regression.sh --stress

View file

@ -1,102 +0,0 @@
language: cpp
dist: focal
os: linux
compiler: gcc
addons:
apt:
packages:
- build-essential
- valgrind
- libstdc++6
- binutils
- python
- uuid-dev
env:
global:
- TOOLDIR=$HOME/tools
cache:
directories:
- $TOOLDIR
- $HOME/third_party
- $HOME/build32
- $HOME/build64
before_install:
- if [ ! -d "$TOOLDIR" ] || [ -z "$(ls -A $TOOLDIR)" ] || [ "$(cat "$TOOLDIR/version.txt")" != "v0.4" ]; then
rm -rf $TOOLDIR;
mkdir -p $TRAVIS_BUILD_DIR/build && cd $TRAVIS_BUILD_DIR/build;
../configure --tooldir=$TOOLDIR;
ci/toolchain_install.sh --all;
echo "v0.3" > "$TOOLDIR/version.txt";
else
echo "using existing tooldir build";
fi
- if [ ! -d "$HOME/third_party" ] || [ -z "$(ls -A $HOME/third_party)" ] || [ "$(cat "$HOME/third_party/version.txt")" != "v0.2" ]; then
cd $TRAVIS_BUILD_DIR;
make -C third_party > /dev/null;
echo "v0.2" > "third_party/version.txt";
cp -rf third_party $HOME;
else
echo "using existing third_party build";
cp -rf $HOME/third_party $TRAVIS_BUILD_DIR;
fi
install:
- if [ ! -d "$HOME/build$XLEN" ] || [ -z "$(ls -A $HOME/build$XLEN)" ] || [ "$(cat "$HOME/build$XLEN/version.txt")" != "$TRAVIS_COMMIT" ]; then
mkdir -p $TRAVIS_BUILD_DIR/build$XLEN && cd $TRAVIS_BUILD_DIR/build$XLEN;
../configure --tooldir=$TOOLDIR --xlen=$XLEN;
source ci/toolchain_env.sh;
make build -s > /dev/null;
echo "$TRAVIS_COMMIT" > version.txt;
cp -rf $TRAVIS_BUILD_DIR/build$XLEN $HOME;
else
echo "using existing build for commit $TRAVIS_COMMIT";
cp -rf $HOME/build$XLEN $TRAVIS_BUILD_DIR;
fi
before_script:
- cd $TRAVIS_BUILD_DIR/build$XLEN
- source ci/toolchain_env.sh
stages:
- test
jobs:
include:
- stage: test
name: regression32
env: XLEN=32
script:
- ./ci/travis_run.py ./ci/regression.sh --unittest
- ./ci/travis_run.py ./ci/regression.sh --isa
- ./ci/travis_run.py ./ci/regression.sh --kernel
- ./ci/travis_run.py ./ci/regression.sh --synthesis
- ./ci/travis_run.py ./ci/regression.sh --regression
- ./ci/travis_run.py ./ci/regression.sh --opencl
- stage: test
name: regression64
env: XLEN=64
script:
- ./ci/travis_run.py ./ci/regression.sh --isa
- ./ci/travis_run.py ./ci/regression.sh --kernel
- ./ci/travis_run.py ./ci/regression.sh --synthesis
- ./ci/travis_run.py ./ci/regression.sh --regression
- ./ci/travis_run.py ./ci/regression.sh --opencl
- stage: test
name: config
env: XLEN=32
script:
- ./ci/travis_run.py ./ci/regression.sh --cluster
- ./ci/travis_run.py ./ci/regression.sh --config
- stage: test
name: debug
env: XLEN=32
script:
- ./ci/travis_run.py ./ci/regression.sh --debug
- ./ci/travis_run.py ./ci/regression.sh --stress