Extended debugging in the REST client module #836
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
# Qserv CI workflow | |
--- | |
name: "CI" | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build image | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Declare Version Variables | |
id: vars | |
shell: bash | |
run: | | |
IMAGE="qserv/ingest:$(git describe --dirty --always)" | |
echo "IMAGE=${IMAGE}" >> $GITHUB_ENV | |
echo "Build and test Qserv ingest image: $IMAGE" | |
- name: Build qserv-ingest image | |
run: | | |
cp env.example.sh env.sh | |
# Set development version | |
sed -i "s/^INGEST_RELEASE=.*$//" env.sh | |
./build.sh | |
mkdir -p artifacts | |
docker save "${{ env.IMAGE }}" > artifacts/image.tar | |
echo "${{ env.IMAGE }}" > artifacts/image-tag | |
- name: Launch unit tests | |
run: | | |
./code-checks.sh -u | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: image | |
path: artifacts | |
image-analysis: | |
name: Analyze image | |
runs-on: ubuntu-22.04 | |
needs: build | |
steps: | |
- name: Download image | |
uses: actions/download-artifact@v3 | |
with: | |
name: image | |
path: artifacts | |
- name: Load image in local registry | |
run: | | |
docker load --input artifacts/image.tar | |
echo "IMAGE=$(cat artifacts/image-tag)" >> $GITHUB_ENV | |
- name: Scan qserv-ingest image | |
uses: anchore/scan-action@v2 | |
with: | |
image: "${{ env.IMAGE }}" | |
acs-report-enable: true | |
- name: upload Anchore scan SARIF report | |
uses: github/codeql-action/upload-sarif@v1 | |
with: | |
sarif_file: results.sarif | |
integration: | |
name: Run integration test on qserv-ingest | |
runs-on: ubuntu-22.04 | |
needs: build | |
env: | |
GHA_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- name: apparmor | |
run: | | |
set -x | |
sudo apt-get remove mysql-server --purge | |
sudo apt-get install apparmor-profiles | |
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | |
- name: Download qserv-ingest image | |
uses: actions/download-artifact@v3 | |
with: | |
name: image | |
path: artifacts | |
- name: Create k8s/kind cluster | |
run: | | |
git clone --depth 1 -b "k8s-1.21.1-1" --single-branch https://github.com/k8s-school/kind-helper.git | |
./kind-helper/k8s-create.sh -s | |
- name: Load container image inside kind | |
run: | | |
kind load image-archive artifacts/image.tar | |
docker exec -- kind-control-plane crictl image | |
- run: | | |
kubectl get nodes | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Pull LFS objects | |
run: git lfs pull | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Install python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install click | |
run: | | |
python -m pip install --upgrade pip | |
pip install click pyyaml requests | |
- name: Deploy Qserv | |
run: ./itest/install-qserv.sh | |
- name: Install pre-requisites | |
run: ./prereq-install.sh | |
- name: Run integration tests | |
run: ./itest/run-tests.sh | |
push: | |
name: Push Qserv ingest image to registry | |
runs-on: ubuntu-22.04 | |
needs: integration | |
steps: | |
- name: Download qserv-ingest image | |
uses: actions/download-artifact@v3 | |
with: | |
name: image | |
path: artifacts | |
- name: Load image in local registry | |
run: | | |
docker load --input artifacts/image.tar | |
echo "IMAGE=$(cat artifacts/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 }} |