chore: don't use whatsmyuseragent.org anymore #816
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
needs: [build] | |
timeout-minutes: 60 | |
steps: | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: actions/checkout@v3 | |
- name: Install k3s | |
run: | | |
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=777 INSTALL_K3S_EXEC="server --docker --disable traefik --kubelet-arg=image-gc-high-threshold=85 --kubelet-arg=image-gc-low-threshold=80" sudo sh - | |
mkdir -p ~/.kube | |
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config | |
sudo chown runner ~/.kube/config | |
- name: Install dependencies | |
run: npm ci | |
working-directory: e2e | |
# Do it before the browsers and dependencies get installed, because it takes long. | |
- name: Generate K8 files | |
run: | | |
version="$(bash .github/workflows/determine_docker_image_tag.sh)" | |
bash k8/generate.sh $version | |
env: | |
WORKER_COUNT: 1 | |
- run: kubectl apply -f k8/ | |
- name: Install Playwright browsers | |
run: npx playwright install | |
working-directory: e2e | |
- name: Install Playwright operating system dependencies | |
run: npx playwright install-deps | |
working-directory: e2e | |
- name: Run e2e tests | |
working-directory: e2e | |
run: | | |
kubectl wait --timeout 10m --for=condition=ready pods --all | |
FRONTEND_PORT=$(kubectl get svc frontend -o=jsonpath='{.spec.ports[?(@.port==8080)].nodePort}') | |
FRONTEND_URL="http://127.0.0.1:$FRONTEND_PORT" | |
echo "Host: $FRONTEND_URL" | |
npx wait-on "$FRONTEND_URL/service/control/health" | |
kubectl wait --timeout 10m --for=condition=ready pod -l role=worker | |
ROOT_TEST_URL=$FRONTEND_URL npm run test | |
- name: Upload test-results | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: e2e-test-results | |
path: e2e/test-results/ | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
directory: | |
- worker-javascript | |
- worker-java | |
- worker-python | |
- worker-csharp | |
- file-service | |
- frontend | |
- control-service | |
- squid | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build image | |
run: docker build . --file ${{ matrix.directory }}/Dockerfile --tag local-image | |
- name: Login to GitHub Package Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Push image | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.directory }} | |
DOCKER_IMAGE_TAG="$(bash .github/workflows/determine_docker_image_tag.sh)" | |
DOCKER_IMAGE="$IMAGE_ID:$DOCKER_IMAGE_TAG" | |
echo "Docker image: $DOCKER_IMAGE" | |
docker tag local-image $DOCKER_IMAGE | |
docker push $DOCKER_IMAGE |