Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Install graceful shutdown on server #22

Install graceful shutdown on server

Install graceful shutdown on server #22

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Cache compilation artefacts
uses: mozilla-actions/[email protected]
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Run trow-server test suite
run: cargo test -p trow-server
- name: Run Trow test suite
run: cargo test -p trow
- name: Smoke test
run: cargo test -- --ignored
build:
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
outputs:
container-image: ${{ steps.meta.outputs.tags }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Cache compilation artefacts
uses: mozilla-actions/[email protected]
- name: Build
run: |
cargo build
mv target/debug/trow trow
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/extrality/trow-dev
- name: Build and push container image
uses: docker/build-push-action@v4
with:
push: true
context: .
file: ./docker/Dockerfile.debug
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
oci-conformance:
runs-on: ubuntu-latest
needs: build
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
services:
trow:
image: ${{ needs.build.outputs.container-image }}
timeout-minutes: 10
steps:
- name: Run OCI Distribution Spec conformance tests
uses: opencontainers/distribution-spec@main
env:
OCI_ROOT_URL: http://trow:8000
OCI_NAMESPACE: oci-conformance/distribution-test
OCI_TEST_PULL: 1
OCI_TEST_PUSH: 1
OCI_TEST_CONTENT_DISCOVERY: 1
OCI_TEST_CONTENT_MANAGEMENT: 1
OCI_HIDE_SKIPPED_WORKFLOWS: 0
OCI_DEBUG: 0
purge-images:
name: Delete old dev images
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: 'trow-dev'
package-type: 'container'
min-versions-to-keep: 5
helm-chart-validation:
runs-on: ubuntu-latest
needs: build
env:
IMAGE: ${{ needs.build.outputs.container-image }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Helm
uses: azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create kind cluster
uses: helm/[email protected]
with:
config: .github/workflows/config/kind.yaml
- name: Install Ingress
run: |
.github/workflows/config/install-kind-ingress.sh
kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
- name: Template values.yaml
run: |
IMAGE_TAG="$(echo '${{ env.IMAGE }}' | awk -F':' '{print $2}')"
sed -i "s|%TROW_IMAGE_TAG%|$IMAGE_TAG|" .github/workflows/config/values.yaml
- name: Helm Install Trow
run: |
helm install trow-test -f .github/workflows/config/values.yaml charts/trow/
- name: Pull and Tag Docker Image
run: |
docker pull nginx:alpine
docker tag nginx:alpine 127.0.0.1/test/nginx:alpine
- name: Push to Trow
run: |
kubectl wait pod/trow-test-0 --for condition=ready --timeout=300s
docker push 127.0.0.1/test/nginx:alpine
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check spelling
uses: crate-ci/[email protected]