diff --git a/.github/workflows/create_push_docker_image.yml b/.github/workflows/create_push_docker_image.yml new file mode 100644 index 00000000..6cc405b7 --- /dev/null +++ b/.github/workflows/create_push_docker_image.yml @@ -0,0 +1,39 @@ +name: Publish SymCC Docker image +# for testing only +on: [pull_request, workflow_dispatch] +# we want to push a docker image when the Compile and test SymCC +# workflow completed successfully +# on: +# workflow_run: +# workflows: [Compile and test SymCC] # Reuse the name of your tests workflow +# branches: master +# types: +# - completed + +jobs: + upload_dockerhub: + # if: github.repository == 'eurecom-s3/symcc' && github.ref == 'refs/heads/master' + # not when testing + # if: ${{ github.event.workflow_run.conclusion == 'success' }} + needs: [ llvm_compatibility, llvm_compatibility_latest_llvm ] + runs-on: ubuntu-latest + steps: + - name: Checkout project sources + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_USERNAME }}/symcc:latest diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 2b0ee654..951f1241 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -1,6 +1,22 @@ name: Compile and test SymCC on: [pull_request, workflow_dispatch] jobs: + # Building and running the tests with Dockerfile + build_and_test_symcc: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Setup docker compilation environment + run: docker build --target builder -t symcc . + - name: Build and test SymCC with simple backend + run: docker build --target builder_simple -t symcc . + - name: Build libcxx using SymCC simple backend + run: docker build --target builder_libcxx -t symcc . + - name: Build and test SymCC with Qsym backend + run: docker build --target builder_qsym -t symcc . + - name: Creation of the final SymCC docker image with Qsym backend and libcxx + + # checking compatibility with ubuntu llvm packages llvm_compatibility: runs-on: ubuntu-22.04 strategy: @@ -15,7 +31,7 @@ jobs: sudo apt-get update sudo apt-get install -y \ llvm-${{ matrix.llvm_version }}-dev \ - libz3-dev \ + libz3-dev - name: Build SymCC with the QSYM backend run: | mkdir build @@ -26,7 +42,9 @@ jobs: -DQSYM_BACKEND=ON \ -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \ .. - make + make tests + + # checking compatibility (compilation only) with more recent packages llvm_compatibility_latest_llvm: runs-on: ubuntu-22.04 strategy: @@ -59,33 +77,4 @@ jobs: -DQSYM_BACKEND=ON \ -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \ .. - make - - # 1- This is all open source anyway, so I figure anyone working on this should maybe create a DockerHub account - # and create secrets to store their username and password to test uploading their changes to symcc. - # Also, deleting the old workflow, as if I kept it, this would build the Docker image twice. - # 2- We should only build and push to DockerHub if this passes all tests - upload_dockerhub: - # if: github.repository == 'eurecom-s3/symcc' && github.ref == 'refs/heads/master' - needs: [ llvm_compatibility, llvm_compatibility_latest_llvm ] - runs-on: ubuntu-latest - steps: - - name: Checkout project sources - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/symcc:latest \ No newline at end of file + make tests diff --git a/README.md b/README.md index 5eaab5c4..4356d0b2 100644 --- a/README.md +++ b/README.md @@ -141,14 +141,16 @@ contains detailed instructions to replicate our experiments, as well as the raw results that we obtained. ### Video demonstration -On YouTube you can find [a practical introduction to SymCC](https://www.youtube.com/watch?v=htDrNBiL7Y8) as well as a video on [how to combine AFL and SymCC](https://www.youtube.com/watch?v=zmC-ptp3W3k) +On YouTube you can find [a practical introduction to +SymCC](https://www.youtube.com/watch?v=htDrNBiL7Y8) as well as a video on [how +to combine AFL and SymCC](https://www.youtube.com/watch?v=zmC-ptp3W3k) ## Building a Docker image If you prefer a Docker container over building SymCC natively, just tell Docker to build the image after pulling the QSYM code as above. (Be warned though: the -Docker image enables optional C++ support from source, so creating -the image can take quite some time!) +Docker image enables optional C++ support from source, so creating the image can +take quite some time!) ``` $ git submodule init @@ -157,7 +159,9 @@ $ docker build -t symcc . $ docker run -it --rm symcc ``` -Alternatively, you can pull from docker hub +Alternatively, you can pull an existing image (current master branch) from +Docker Hub: + ``` $ docker pull eurecoms3/symcc $ docker run -it --rm symcc