Update current feature #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Qserv e2e workflow for ssi results protocol" | |
on: | |
push: | |
jobs: | |
build: | |
name: Build image | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Uninstall go provided by Ubuntu | |
run: | | |
sudo apt-get remove golang-go | |
sudo apt-get remove --auto-remove golang-go | |
sudo apt-get purge golang-go | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.19.2' | |
- run: go version | |
- name: Install go dependencies | |
run: | | |
go install golang.org/x/tools/cmd/goimports@latest | |
- name: Declare Version Variables | |
id: vars | |
shell: bash | |
run: | | |
OP_VERSION="$(git describe --always)" | |
echo "OP_IMAGE=$(. ./env.build.sh && echo $OP_IMAGE)" >> $GITHUB_ENV | |
echo "OP_IMAGE=${OP_IMAGE}" | |
- name: Install pre-requisites for build (Operator SDK) | |
run: ./prereq-build.sh | |
- name: Run Unit Tests | |
run: make test | |
- name: Build operator image | |
run: | | |
go mod download | |
./build.sh | |
mkdir -p artifacts | |
docker save "${{ env.OP_IMAGE }}" > artifacts/qserv-operator-image.tar | |
echo "${{ env.OP_IMAGE }}" > artifacts/qserv-operator-image-tag | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: docker-artifact | |
path: artifacts | |
image-analysis: | |
name: Analyze image | |
runs-on: ubuntu-22.04 | |
permissions: | |
security-events: write | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download image | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker-artifact | |
path: artifacts | |
- name: Load image in local registry | |
run: | | |
docker load --input artifacts/qserv-operator-image.tar | |
echo "OP_IMAGE=$(cat artifacts/qserv-operator-image-tag)" >> $GITHUB_ENV | |
- name: Scan operator image | |
uses: anchore/scan-action@v3 | |
id: scan | |
with: | |
image: "${{ env.OP_IMAGE }}" | |
acs-report-enable: true | |
fail-build: false | |
- name: Display SARIF report | |
run: | | |
cat ${{ steps.scan.outputs.sarif }} | |
- name: upload Anchore scan SARIF report | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: ${{ steps.scan.outputs.sarif }} | |
e2e: | |
strategy: | |
max-parallel: 1 | |
matrix: | |
results_protocol: [base] | |
uses: ./.github/workflows/itest.yml | |
needs: build | |
with: | |
results_protocol: ${{ matrix.results_protocol }} | |
push: | |
name: Push qserv-operator image to public registry | |
runs-on: ubuntu-22.04 | |
needs: e2e | |
steps: | |
- name: Download qserv-operator image | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker-artifact | |
path: artifacts | |
- name: Load image in local registry | |
run: | | |
docker load --input artifacts/qserv-operator-image.tar | |
echo "IMAGE=$(cat artifacts/qserv-operator-image-tag)" >> $GITHUB_ENV | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push image to Docker Hub | |
run: | | |
docker push ${{ env.IMAGE }} |