Skip to content

Commit

Permalink
modify CI build to run tests etc
Browse files Browse the repository at this point in the history
Signed-off-by: jdolitsky <[email protected]>
  • Loading branch information
jdolitsky committed Sep 14, 2020
1 parent 357600f commit 6b2e745
Showing 1 changed file with 37 additions and 22 deletions.
59 changes: 37 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
name: Deploy multi-architecture Docker images for chartmuseum with buildx
name: build

on:
schedule:
- cron: '0 0 * * *' # everyday at midnight UTC
pull_request:
branches: master
push:
branches: master
branches: main
tags:
- v*

jobs:
buildx:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
-
name: Prepare
- name: setup go environment
uses: actions/setup-go@v1
with:
go-version: '1.15.2'
- name: download dependencies
run: make bootstrap
- name: run unit tests
run: make test
- name: build binary
run: make build-linux
- name: run acceptance tests
run: sudo pip install virtualenv && make acceptance
- name: upload coverage report
uses: actions/upload-artifact@master
with:
name: chartmuseum-coverage-report-${{ github.sha }}
path: .cover/
if: always()
- name: upload acceptance test report
uses: actions/upload-artifact@master
with:
name: chartmuseum-acceptance-report-${{ github.sha }}
path: .robot/
if: always()
- name: Prepare
id: prepare
run: |
DOCKER_IMAGE=chartmuseumstage/chartmuseum
DOCKER_IMAGE=chartmuseum/chartmuseum
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386
VERSION=edge
Expand All @@ -40,33 +60,28 @@ jobs:
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
--build-arg revision=$(git rev-parse --short HEAD) \
${TAGS} .
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
-
name: Docker Buildx (build)
- name: Docker Buildx (build)
run: |
docker buildx build --no-cache --pull --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
-
name: Docker Login
- name: Docker Login
if: success() && github.event_name != 'pull_request'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
-
name: Docker Buildx (push)
- name: Docker Buildx (push)
if: success() && github.event_name != 'pull_request'
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
-
name: Docker Check Manifest
- name: Docker Check Manifest
if: always() && github.event_name != 'pull_request'
run: |
docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
-
name: Clear
- name: Clear
if: always() && github.event_name != 'pull_request'
run: |
rm -f ${HOME}/.docker/config.json

0 comments on commit 6b2e745

Please sign in to comment.