From 84521a5c82be6d1aca6d18369b8a6e8dd316beff Mon Sep 17 00:00:00 2001 From: Philippe Tillet Date: Tue, 27 Jul 2021 17:57:02 -0700 Subject: [PATCH] [CI] Switch to Github Actions (#143) --- .ci/azure-pipelines.yml | 37 ------------------- .ci/build-website.yml | 30 ---------------- .ci/build-wheels.yml | 44 ----------------------- .github/workflows/build-website.yml | 42 ++++++++++++++++++++++ .github/workflows/build-wheels.yml | 47 +++++++++++++++++++++++++ .github/workflows/integration-tests.yml | 34 ++++++++++++++++++ 6 files changed, 123 insertions(+), 111 deletions(-) delete mode 100644 .ci/azure-pipelines.yml delete mode 100644 .ci/build-website.yml delete mode 100644 .ci/build-wheels.yml create mode 100644 .github/workflows/build-website.yml create mode 100644 .github/workflows/build-wheels.yml create mode 100644 .github/workflows/integration-tests.yml diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml deleted file mode 100644 index 77cb8a607..000000000 --- a/.ci/azure-pipelines.yml +++ /dev/null @@ -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' \ No newline at end of file diff --git a/.ci/build-website.yml b/.ci/build-website.yml deleted file mode 100644 index fc2ea8744..000000000 --- a/.ci/build-website.yml +++ /dev/null @@ -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 - \ No newline at end of file diff --git a/.ci/build-wheels.yml b/.ci/build-wheels.yml deleted file mode 100644 index c8cd2074c..000000000 --- a/.ci/build-wheels.yml +++ /dev/null @@ -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 - \ No newline at end of file diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml new file mode 100644 index 000000000..33be126fc --- /dev/null +++ b/.github/workflows/build-website.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 000000000..389e6c3b0 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -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) \ No newline at end of file diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 000000000..21f3f3ea3 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -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 . \ No newline at end of file