Skip to content

Update module github.com/nats-io/nats.go to v1.52.0 #103

Update module github.com/nats-io/nats.go to v1.52.0

Update module github.com/nats-io/nats.go to v1.52.0 #103

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
branches:
- main
paths-ignore:
- "**.md"
release:
types: [released, prereleased]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
actions: write
env:
GO_VERSION: "1.25"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: go vet (all modules)
run: make lint
- name: gofmt check
run: |
set -e
changed=$(gofmt -l HadesAPI HadesScheduler HadesLogManager shared)
if [ -n "$changed" ]; then
echo "::error title=gofmt::Run 'make fmt' locally; the following files need formatting:"
echo "$changed"
exit 1
fi
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: go build (all modules)
run: make build
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: shared
path: shared
- name: HadesAPI
path: HadesAPI
- name: HadesScheduler
path: HadesScheduler
- name: HadesLogManager
path: HadesLogManager
- name: HadesOperator
path: HadesScheduler/HadesOperator
steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: Install dependencies
run: cd ${{ matrix.path }} && go mod download
- name: Test
run: cd ${{ matrix.path }} && go test ./... -json > "${{ github.workspace }}/TestResults-${{ matrix.name }}.json"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: Go-results-${{ matrix.name }}
path: TestResults-${{ matrix.name }}.json
build-api:
needs: [lint, build, test]
if: github.actor != 'dependabot[bot]'
uses: ls1intum/.github/.github/workflows/build-and-push-docker-image.yml@v1.2.0
with:
image-name: ls1intum/hades/hades-api
docker-file: ./HadesAPI/Dockerfile
secrets: inherit
build-scheduler:
needs: [lint, build, test]
if: github.actor != 'dependabot[bot]'
uses: ls1intum/.github/.github/workflows/build-and-push-docker-image.yml@v1.2.0
with:
image-name: ls1intum/hades/hades-scheduler
docker-file: ./HadesScheduler/Dockerfile
secrets: inherit
build-operator:
needs: [lint, build, test]
if: github.actor != 'dependabot[bot]'
uses: ls1intum/.github/.github/workflows/build-and-push-docker-image.yml@v1.2.0
with:
image-name: ls1intum/hades/hades-operator
docker-file: ./HadesScheduler/HadesOperator/Dockerfile
secrets: inherit
deploy-traefik:
needs: [build-api, build-scheduler]
uses: ls1intum/.github/.github/workflows/deploy-docker-traefik.yml@main
with:
environment: hades-test
image-tag: v3.6
secrets: inherit
deploy:
needs: [build-api, build-scheduler]
runs-on: ubuntu-latest
environment: hades-test
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Copy deployment files to VM
uses: appleboy/scp-action@v1.0.0
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
source: "docker-compose.test.yml"
target: /opt/hades
strip_components: 0
- name: Create .env file on VM
uses: appleboy/ssh-action@v1.2.5
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
script: |
install -m 600 /dev/null /opt/hades/.env
cat > /opt/hades/.env <<'EOF'
IMAGE_TAG=${{ needs.build-api.outputs.image_tag }}
HADES_API_HOST=${{ vars.HADES_API_HOST }}
LETSENCRYPT_EMAIL=${{ vars.LETSENCRYPT_EMAIL }}
AUTH_KEY=${{ secrets.AUTH_KEY }}
EOF
- name: Deploy with docker compose
uses: appleboy/ssh-action@v1.2.5
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
script: |
cd /opt/hades
docker compose -f docker-compose.test.yml up --pull=always -d --remove-orphans
docker image prune -af --filter "until=24h"