[CI] Switch to Github Actions (#143)

This commit is contained in:
Philippe Tillet
2021-07-27 17:57:02 -07:00
committed by GitHub
parent 52d311f302
commit 84521a5c82
6 changed files with 123 additions and 111 deletions

View File

@@ -1,37 +0,0 @@
name: Triton CI
workspace:
clean: all
pool:
name: default
# Some variables
variables:
- name: venv
value: venv
# Run CI when something pushed to master
trigger: none
# Run CI when a PR is created or updated from master
pr:
- master
# Pipeline
steps:
- script: |
alias python='python3'
cd python
pip3 install -e .
displayName: Setup python environment
- script: |
cd python/bench
python3 -m run
- publish: python/bench/results
artifact: Benchmarks
- script: |
pytest .
displayName: 'Run Python tests'

View File

@@ -1,30 +0,0 @@
name: Build Website
trigger: none
pr: none
jobs:
- job: linux
workspace:
clean: all
pool: default
steps:
- bash: |
set -o errexit
cd python
pip3 install -e .
displayName: Install dependencies
- bash: |
cd docs
make html
displayName: Build docs
- bash: |
git checkout gh-pages
sh ./update-website.sh
git remote set-url origin git@github.com:ptillet/triton.git
git push
displayName: Publish docs

View File

@@ -1,44 +0,0 @@
trigger: none
pr: none
jobs:
- job: linux
workspace:
clean: all
timeoutInMinutes: 180
pool: default
steps:
- bash: |
set -o errexit
python3 --version
python3 -m pip install --upgrade pip
pip3 install cibuildwheel==2.0.0
pip3 install twine
displayName: Install dependencies
- bash: |
#sed -i 's/name\=\"triton\"/name="triton-nightly"/g' python/setup.py
export LATEST_DATE=$(git show -s --format=%ci `git rev-parse HEAD` | cut -d ' ' -f 1 | sed 's/-//g')
sed -i -r "s/version\=\"(.*)\"/version=\"\1-dev"$LATEST_DATE"\"/g" python/setup.py
echo "" >> python/setup.cfg
echo "[build_ext]" >> python/setup.cfg
echo "base-dir=/project" >> python/setup.cfg
displayName: Patch setup.py
- bash: |
export CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014"
export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="manylinux2014"
export CIBW_BEFORE_BUILD="pip install cmake;\
yum install -y llvm11 llvm11-devel llvm11-static llvm11-libs zlib-devel;"
export CIBW_SKIP="{cp,pp}35-*"
export CIBW_BUILD="{cp,pp}3*-manylinux_x86_64"
python3 -m cibuildwheel python --output-dir wheelhouse
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
- bash: |
python3 -m twine upload wheelhouse/* --skip-existing -u $(PYPI_USERNAME) -p $(PYPI_PASSWORD)
displayName: Upload wheels to PyPI

42
.github/workflows/build-website.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Build Website
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Trigger website build'
schedule:
- cron: "0 0 * * *"
jobs:
Build-Website:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Triton
run: |
alias python='python3'
cd python
pip3 install -e .
- name: Build docs
run: |
cd docs
make html
- name: Publish docs
run: |
git checkout gh-pages
sh ./update-website.sh
git remote set-url origin git@github.com:ptillet/triton.git
git push
displayName: Publish docs

47
.github/workflows/build-wheels.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Build Wheels
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Trigger wheels build'
schedule:
- cron: "0 0 * * *"
jobs:
Build-Wheels:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Patch setup.py
run: |
#sed -i 's/name\=\"triton\"/name="triton-nightly"/g' python/setup.py
export LATEST_DATE=$(git show -s --format=%ci `git rev-parse HEAD` | cut -d ' ' -f 1 | sed 's/-//g')
sed -i -r "s/version\=\"(.*)\"/version=\"\1-dev"$LATEST_DATE"\"/g" python/setup.py
echo "" >> python/setup.cfg
echo "[build_ext]" >> python/setup.cfg
echo "base-dir=/project" >> python/setup.cfg
- name: Build wheels
run: |
export CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014"
export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="manylinux2014"
export CIBW_BEFORE_BUILD="pip install cmake;\
yum install -y llvm11 llvm11-devel llvm11-static llvm11-libs zlib-devel;"
export CIBW_SKIP="{cp,pp}35-*"
export CIBW_BUILD="{cp,pp}3*-manylinux_x86_64"
python3 -m cibuildwheel python --output-dir wheelhouse
- name: Upload wheels to PyPI
run: |
python3 -m twine upload wheelhouse/* --skip-existing -u $(PYPI_USERNAME) -p $(PYPI_PASSWORD)

34
.github/workflows/integration-tests.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Integration Tests
on:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
Integration-Tests:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Triton
run: |
alias python='python3'
cd python
pip3 install -e .
- name: Run benchmarks
run: |
cd python/bench
python3 -m run
- name: Run unit tests
run: |
pytest .