Skip to content

Commit 2ec0602

Browse files
committed
Initial docker image creation workflows.
1 parent 289fc7a commit 2ec0602

22 files changed

+340
-18
lines changed

.circleci/config.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,11 @@ defaults:
3333
3434
- run_build: &run_build
3535
name: Build
36-
command: |
37-
set -ex
38-
if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" -o -n "$FORCE_RELEASE" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
39-
echo -n "$CIRCLE_SHA1" > commit_hash.txt
40-
mkdir -p build
41-
cd build
42-
[ -n "$COVERAGE" -a "$CIRCLE_BRANCH" != release -a -z "$CIRCLE_TAG" ] && CMAKE_OPTIONS="$CMAKE_OPTIONS -DCOVERAGE=ON"
43-
cmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} $CMAKE_OPTIONS -G "Unix Makefiles"
44-
make -j4
36+
command: scripts/ci/build.sh
4537

4638
- run_build_ossfuzz: &run_build_ossfuzz
4739
name: Build_ossfuzz
48-
command: |
49-
mkdir -p build
50-
cd build
51-
protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
52-
protoc --proto_path=../test/tools/ossfuzz abiV2Proto.proto --cpp_out=../test/tools/ossfuzz
53-
protoc --proto_path=../test/tools/ossfuzz solProto.proto --cpp_out=../test/tools/ossfuzz
54-
cmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} $CMAKE_OPTIONS
55-
make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j4
40+
command: scripts/ci/build_ossfuzz.sh
5641

5742
- run_proofs: &run_proofs
5843
name: Correctness proofs for optimization rules
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: buildpack-deps:emscripten
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/buildpack-deps-emscripten.yml'
7+
- 'scripts/docker/buildpack-deps/Dockerfile.emscripten'
8+
9+
jobs:
10+
build:
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
DOCKER_REPOSITORY: docker.pkg.github.com/${{ github.repository }}
14+
IMAGE_NAME: buildpack-deps
15+
IMAGE_VARIANT: emscripten
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Upgrade ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VARIANT }}
23+
run: |
24+
echo "${GITHUB_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin
25+
scripts/ci/docker_upgrade.sh
26+
docker logout docker.pkg.github.com
27+
28+
- name: comment PR
29+
uses: aarlt/[email protected]
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
34+
check_for_duplicate_msg: false # OPTIONAL
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: buildpack-deps:ubuntu1604.clang.ossfuzz
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/buildpack-deps-ubuntu1604.clang.ossfuzz.yml'
7+
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu1604.clang.ossfuzz'
8+
9+
jobs:
10+
build:
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
DOCKER_REPOSITORY: docker.pkg.github.com/${{ github.repository }}
14+
IMAGE_NAME: buildpack-deps
15+
IMAGE_VARIANT: ubuntu1604.clang.ossfuzz
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Upgrade ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VARIANT }}
23+
run: |
24+
echo "${GITHUB_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin
25+
scripts/ci/docker_upgrade.sh
26+
docker logout docker.pkg.github.com
27+
28+
- name: comment PR
29+
uses: aarlt/[email protected]
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
34+
check_for_duplicate_msg: false # OPTIONAL
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: buildpack-deps:ubuntu1804
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/buildpack-deps-ubuntu1804.yml'
7+
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu1804'
8+
9+
jobs:
10+
build:
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
DOCKER_REPOSITORY: docker.pkg.github.com/${{ github.repository }}
14+
IMAGE_NAME: buildpack-deps
15+
IMAGE_VARIANT: ubuntu1804
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Upgrade ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VARIANT }}
23+
run: |
24+
echo "${GITHUB_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin
25+
scripts/ci/docker_upgrade.sh
26+
docker logout docker.pkg.github.com
27+
28+
- name: comment PR
29+
uses: aarlt/[email protected]
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
34+
check_for_duplicate_msg: false # OPTIONAL
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: buildpack-deps:ubuntu2004.clang
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/buildpack-deps-ubuntu2004.clang.yml'
7+
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2004.clang'
8+
9+
jobs:
10+
build:
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
DOCKER_REPOSITORY: docker.pkg.github.com/${{ github.repository }}
14+
IMAGE_NAME: buildpack-deps
15+
IMAGE_VARIANT: ubuntu2004.clang
16+
CC: clang
17+
CXX: clang++
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Upgrade ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VARIANT }}
25+
run: |
26+
echo "${GITHUB_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin
27+
scripts/ci/docker_upgrade.sh
28+
docker logout docker.pkg.github.com
29+
30+
- name: comment PR
31+
uses: aarlt/[email protected]
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
36+
check_for_duplicate_msg: false # OPTIONAL
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: buildpack-deps:ubuntu2004
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/buildpack-deps-ubuntu2004.yml'
7+
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2004'
8+
jobs:
9+
build:
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
DOCKER_REPOSITORY: docker.pkg.github.com/${{ github.repository }}
13+
IMAGE_NAME: buildpack-deps
14+
IMAGE_VARIANT: ubuntu2004
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Upgrade ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VARIANT }}
22+
run: |
23+
echo "${GITHUB_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin
24+
scripts/ci/docker_upgrade.sh
25+
docker logout docker.pkg.github.com
26+
27+
- name: comment PR
28+
uses: aarlt/[email protected]
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
33+
check_for_duplicate_msg: false # OPTIONAL

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ prerelease.txt
3232

3333
# Build directory
3434
build/
35-
build*/
35+
/build*/
3636
emscripten_build/
3737
docs/_build
3838
__pycache__

scripts/ci/build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
ROOTDIR="$(dirname "$0")/../.."
5+
cd "${ROOTDIR}"
6+
7+
# shellcheck disable=SC2166
8+
if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" -o -n "$FORCE_RELEASE" ]; then echo -n >prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" >prerelease.txt; fi
9+
if [ -n "$CIRCLE_SHA1" ]
10+
then
11+
echo -n "$CIRCLE_SHA1" >commit_hash.txt
12+
fi
13+
14+
mkdir -p build
15+
cd build
16+
17+
# shellcheck disable=SC2166
18+
[ -n "$COVERAGE" -a "$CIRCLE_BRANCH" != release -a -z "$CIRCLE_TAG" ] && CMAKE_OPTIONS="$CMAKE_OPTIONS -DCOVERAGE=ON"
19+
20+
# shellcheck disable=SC2086
21+
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" $CMAKE_OPTIONS -G "Unix Makefiles"
22+
make -j4

scripts/ci/build_ossfuzz.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
ROOTDIR="$(dirname "$0")/../.."
5+
BUILDDIR="${ROOTDIR}/build"
6+
7+
mkdir -p "${BUILDDIR}"
8+
cd "${BUILDDIR}"
9+
10+
protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
11+
protoc --proto_path=../test/tools/ossfuzz abiV2Proto.proto --cpp_out=../test/tools/ossfuzz
12+
protoc --proto_path=../test/tools/ossfuzz solProto.proto --cpp_out=../test/tools/ossfuzz
13+
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/libfuzzer.cmake
14+
make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j4
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../scripts/travis-emscripten/build_emscripten.sh

0 commit comments

Comments
 (0)