|
| 1 | +name: Build and Test Dynamatic on Ubuntu Latest |
| 2 | + |
| 3 | +on: |
| 4 | + # Make sure that settings are set to require permission |
| 5 | + # to run workflows by external contributors! |
| 6 | + pull_request: |
| 7 | + paths-ignore: |
| 8 | + - 'docs/**' |
| 9 | + branches: ["main"] |
| 10 | + types: [opened, synchronize, reopened, ready_for_review] |
| 11 | + |
| 12 | + push: |
| 13 | + paths-ignore: |
| 14 | + - 'docs/**' |
| 15 | + branches: ["main"] |
| 16 | + |
| 17 | +concurrency: |
| 18 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 19 | + cancel-in-progress: true |
| 20 | + |
| 21 | +jobs: |
| 22 | + build-release: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + env: |
| 25 | + DEBIAN_FRONTEND: noninteractive |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Update apt and install prerequisites |
| 32 | + run: | |
| 33 | + sudo apt-get -y update |
| 34 | + sudo apt-get -y install software-properties-common |
| 35 | + sudo add-apt-repository ppa:deadsnakes/ppa |
| 36 | +
|
| 37 | + - name: Install system dependencies |
| 38 | + run: | |
| 39 | + sudo apt-get install -y \ |
| 40 | + --option APT::Immediate-Configure=false \ |
| 41 | + sudo vim clang lld ccache cmake wget \ |
| 42 | + ninja-build python3 graphviz git curl \ |
| 43 | + gzip libreadline-dev \ |
| 44 | + libboost-all-dev pkg-config python3.12 \ |
| 45 | + python3.12-venv python3.12-dev \ |
| 46 | + ghdl verilator |
| 47 | +
|
| 48 | + - name: Verify Python 3.12 |
| 49 | + run: python3.12 --version |
| 50 | + |
| 51 | + - name: Build Dynamatic (release, prebuilt LLVM) |
| 52 | + run: | |
| 53 | + bash ./build.sh --release --use-prebuilt-llvm --enable-cbc |
| 54 | +
|
| 55 | + build-debug: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + env: |
| 58 | + DEBIAN_FRONTEND: noninteractive |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: Checkout repository |
| 62 | + uses: actions/checkout@v4 |
| 63 | + |
| 64 | + - name: Update apt and install prerequisites |
| 65 | + run: | |
| 66 | + sudo apt-get -y update |
| 67 | + sudo apt-get -y install software-properties-common |
| 68 | + sudo add-apt-repository ppa:deadsnakes/ppa |
| 69 | +
|
| 70 | + - name: Install system dependencies |
| 71 | + run: | |
| 72 | + sudo apt-get install -y \ |
| 73 | + --option APT::Immediate-Configure=false \ |
| 74 | + sudo vim clang lld ccache cmake wget \ |
| 75 | + ninja-build python3 graphviz git curl \ |
| 76 | + gzip libreadline-dev \ |
| 77 | + libboost-all-dev pkg-config python3.12 \ |
| 78 | + python3.12-venv python3.12-dev \ |
| 79 | + ghdl verilator |
| 80 | +
|
| 81 | + - name: Verify Python 3.12 |
| 82 | + run: python3.12 --version |
| 83 | + |
| 84 | + - name: Build Dynamatic (debug, prebuilt LLVM) |
| 85 | + run: | |
| 86 | + bash ./build.sh --use-prebuilt-llvm --enable-cbc |
| 87 | +
|
| 88 | + build-release-docker-image: |
| 89 | + runs-on: ubuntu-latest |
| 90 | + |
| 91 | + steps: |
| 92 | + - name: Checkout repository |
| 93 | + uses: actions/checkout@v4 |
| 94 | + |
| 95 | + - name: Set up Docker Buildx |
| 96 | + uses: docker/setup-buildx-action@v3 |
| 97 | + |
| 98 | + - name: Build Docker image |
| 99 | + run: docker build -t dynamatic-image . --build-arg UID=$(id -u) --build-arg GID=$(id -g) |
| 100 | + |
| 101 | + |
| 102 | + - name: Run container tests (release, prebuilt LLVM) |
| 103 | + run: docker run -u $(id -u):$(id -g) -v "$(pwd):/home/ubuntu/dynamatic" -w "/home/ubuntu/dynamatic" dynamatic-image /bin/bash build.sh --use-prebuilt-llvm --release |
0 commit comments