Skip to content

Commit

Permalink
Build docker images in CI (#836)
Browse files Browse the repository at this point in the history
* Build docker images in CI
  • Loading branch information
Jared Weakly authored Sep 2, 2020
1 parent 5ec88ad commit 883cb13
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ build() {
ghc_ver="$(ghc --numeric-version)"
cp cabal.GHC-"$ghc_ver".config cabal.project.freeze
cabal v2-update
# Limit jobs on windows due to: https://gitlab.haskell.org/ghc/ghc/issues/17926
if [[ "$ghc_ver" =~ 8.8.3|8.10.1 && $IS_WIN ]]; then JOBS=1; else JOBS=2; fi
cabal v2-configure -j$JOBS --minimize-conflict-set
cabal v2-configure -j2 --minimize-conflict-set
tee -a cabal.project > /dev/null < cabal.project.ci
if ! retry cabal v2-build "$@" saw jss && [[ "$RUNNER_OS" == "macOS" ]]; then
echo "Working around a dylib issue on macos by removing the cache and trying again"
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ jobs:
name: Warn if tests failed
run: echo "::error ::Test Suite Failed. Pipeline allowed to pass until tests are reliable."

docker:
runs-on: ubuntu-latest
needs: [outputs]
if: contains(needs.outputs.outputs.changed, 'Dockerfile')
steps:
- uses: actions/checkout@v2
- run: |
git submodule update --init
git -C deps/abcBridge submodule update --init
- name: Publish to Registry
uses: docker/build-push-action@v1
with:
repository: galoisinc/saw
push: false

s2n-tests:
name: "Test s2n proofs"
needs: build
Expand Down Expand Up @@ -225,7 +240,7 @@ jobs:
hub release create -d -m "$body" "$tag"
fi
assets=()
find ./artifacts \( -name 'saw*.tar.gz*' -o -name '*.msi*' \) -type f -print0 |
find ./artifacts \( -name 'saw*.tar.gz*' \) -type f -print0 |
while IFS= read -r -d '' a; do assets+=("-a" "$a"); done
hub release edit -d "${assets[@]}" -m "" "$tag"
env:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Docker
on:
push:
tags: ["[0-9]+.[0-9]+.[0-9]+"]

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git submodule update --init
git -C deps/abcBridge submodule update --init
- run: .github/ci.sh set_version
id: outputs
- name: Publish to Registry
uses: docker/build-push-action@v1
with:
username: ${{ secrets.GITHUBSAW_USERNAME }}
password: ${{ secrets.GITHUBSAW }}
repository: galoisinc/saw
tags: "latest,${{ steps.outputs.outputs.saw-version }}"
add_git_labels: true
push: true

0 comments on commit 883cb13

Please sign in to comment.