Skip to content

Commit

Permalink
Merge pull request #434 from facebookresearch/release-v0.2.0
Browse files Browse the repository at this point in the history
CompilerGym Release v0.2.0
  • Loading branch information
ChrisCummins committed Sep 29, 2021
2 parents e48d497 + f511941 commit 9002afc
Show file tree
Hide file tree
Showing 201 changed files with 30,136 additions and 31,672 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@ description: Install build dependencies
runs:
using: composite
steps:
- name: Install dependencies (linux)
- name: Install dependencies
run: |
if [ "$(uname)" != "Darwin" ]; then
if [ "$(uname)" = "Darwin" ]; then
brew install bazelisk zlib
else
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64" > bazel
chmod +x bazel
sudo mv bazel /usr/local/bin/bazel
sudo apt-get install clang-9 patchelf
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
fi
shell: bash

- name: Install dependencies (macos)
run: |
if [ "$(uname)" = "Darwin" ]; then
brew install bazelisk zlib
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
sudo apt-get install -y clang-9 patchelf
fi
python -m pip install -U pip wheel
python -m pip install -r compiler_gym/requirements.txt
shell: bash
env:
LDFLAGS: -L/usr/local/opt/zlib/lib
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/install-docker/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Install build dependencies
description: Install build dependencies
runs:
using: composite
steps:
- name: Install dependencies (linux)
run: |
if [ "$(uname)" != "Darwin" ]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
fi
shell: bash

- name: Install dependencies (macos)
run: |
if [ "$(uname)" = "Darwin" ]; then
brew cask install docker
fi
shell: bash
12 changes: 12 additions & 0 deletions .github/actions/install-runtime-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Install runtime dependencies
description: Install the runtime dependencies for CompilerGym.
runs:
using: composite
steps:
- name: Install runtime dependencies
run: |
if [ "$(uname)" = "Darwin" ]; then
brew install zlib
fi
shell: bash
97 changes: 97 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
# This workflow is used to build the binary wheels that can be uploaded to pypi
# for releases. It produces an artifact containing a macOS and manylinux binary
# wheel from the requested branch. It also runs the full test suite against
# these wheels.
name: Build Binaries

on:
workflow_dispatch:
pull_request:
branches: [stable]
push:
branches: [stable]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2

- name: Evaluate artifact name
run: |
echo "ARTIFACT=compiler_gym-$(cat VERSION)" >> $GITHUB_ENV
echo "Artifact name is $ARTIFACT"
- uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies

- name: Build Python wheel
run: |
if [ "$(uname)" = "Darwin" ]; then
make bdist_wheel
else
make bdist_wheel-linux
fi
env:
BAZEL_OPTS: --batch
BAZEL_FETCH_OPTS: --config=ci
BAZEL_BUILD_OPTS: --config=ci -c opt

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT }}
path: dist/*.whl
if-no-files-found: error
retention-days: 14

examples-test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
python: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2

- name: Evaluate artifact name
run: |
echo "ARTIFACT=compiler_gym-$(cat VERSION)" >> $GITHUB_ENV
echo "Artifact name is $ARTIFACT"
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT }}

- name: Install wheel
run: |
if [ "$(uname)" = "Darwin" ]; then
python -m pip install compiler_gym-*-macosx*.whl
else
python -m pip install compiler_gym-*-manylinux*.whl
fi
- name: Install runtime dependencies
uses: ./.github/actions/install-runtime-dependencies

- name: Install test dependencies
run: python -m pip install -r examples/requirements.txt -r tests/requirements.txt

- name: Run the examples tests
run: make examples-test
Loading

0 comments on commit 9002afc

Please sign in to comment.