Skip to content

Commit

Permalink
ci: split into more actions
Browse files Browse the repository at this point in the history
  • Loading branch information
caballa committed Sep 16, 2023
1 parent cbfcb56 commit 9ce8172
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 24 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/nightly-clam-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Workflow to push clam image in dockerhub

name: Nightly

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev14 branch
schedule:
- cron: 0 0 * * * # run every day at UTC 00:00
workflow_dispatch:
branches: dev14
inputs:
Triggerer:
description: 'Triggered by:'
required: true
default: ''


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v2
with:
ref: dev14
- name: Build clam and run tests
run: docker build -t seahorn/clam-llvm14:nightly -f docker/clam.Dockerfile .
# Logging in using this mechanism prints the following warning
# WARNING! Your password will be stored unencrypted in /home/runner/.docker/config.json.
# There does not seem to be an easy way around it though using docker actions may mitigate
# it.
- name: Login to DockerHub Registry
if: ${{ github.event_name == 'schedule' }} # only push if nightly run
run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Tag and push clam (nightly)
if: ${{ github.event_name == 'schedule' }} # only push if nightly run
run: |
docker push seahorn/clam-llvm14:nightly
28 changes: 28 additions & 0 deletions .github/workflows/test-clam-dev14-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Workflow to build and test clam after each push or pull request

name: CI-dev14

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev14 branch
push:
branches: dev14
pull_request:
branches: dev14

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v2
with:
ref: dev14
- name: Build clam and run tests
run: docker build -t seahorn/clam-llvm14:nightly -f docker/clam.Dockerfile .
25 changes: 6 additions & 19 deletions .github/workflows/test-clam-docker.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# workflow to build and test clam
# Workflow to build and test clam after each push or pull request

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master and dev14 branches
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master, dev14]
branches: master
pull_request:
branches: [master, dev14]
schedule:
- cron: 0 0 * * * # run every day at UTC 00:00
branches: master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -25,17 +23,6 @@ jobs:
- name: Check out repo
uses: actions/checkout@v2
with:
ref: master
ref: master
- name: Build clam and run tests
run: docker build --build-arg BRANCH=master -t seahorn/clam-llvm14:nightly -f docker/clam.Dockerfile .
# Logging in using this mechanism prints the following warning
# WARNING! Your password will be stored unencrypted in /home/runner/.docker/config.json.
# There does not seem to be an easy way around it though using docker actions may mitigate
# it.
- name: Login to DockerHub Registry
if: ${{ github.event_name == 'schedule' }} # only push if nightly run
run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Tag and push clam (nightly)
if: ${{ github.event_name == 'schedule' }} # only push if nightly run
run: |
docker push seahorn/clam-llvm14:nightly
run: docker build -t seahorn/clam-llvm14:nightly -f docker/clam.Dockerfile .
5 changes: 0 additions & 5 deletions docker/clam.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ FROM seahorn/buildpack-deps-seahorn:$BASE_IMAGE
# Needed to run clang with -m32
RUN apt-get install -yqq libc6-dev-i386

#ARG BRANCH=dev14
#RUN cd / && rm -rf /clam && \
# git clone -b $BRANCH https://github.com/seahorn/clam.git clam --depth=10 ; \
# mkdir -p /clam/build

# Assume that docker-build is ran in the top-level Clam directory
COPY . /clam
# Re-create the build directory that might have been present in the source tree
Expand Down

0 comments on commit 9ce8172

Please sign in to comment.