A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

via/alice-sdv-demo Private

A-SW 코드-배포 파이프라인 검증용 ALICE SDV 예제

https://git.agrithing.ai/via/alice-sdv-demo.git
13 commits
1 items · main
·/ .gitea/workflows/asw-pipeline.yml
yaml · 3.3 KB · 354102e Download
name: A-SW ALICE pipelineon:  push:    branches: [main, "feature/**"]  pull_request:jobs:  contracts:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - name: Validate machine-readable contracts        run: python -m json.tool contracts/telemetry.schema.json >/dev/null  quality:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - name: Validate Python quality profile        run: python -m json.tool .asw/quality-profile.json >/dev/null      - name: Static analysis · Python AST policy        run: python tools/quality_scan.py static --output dist/quality/static-analysis.json      - name: Dynamic analysis · unittest scenarios        run: python tools/quality_scan.py dynamic --output dist/quality/dynamic-analysis.json      - name: Assemble quality summary        run: python tools/quality_scan.py summary --output dist/quality/summary.json      - name: Store quality evidence        uses: christopherhx/gitea-upload-artifact@v4        with:          name: alice-quality-evidence          path: dist/quality          retention-days: 30  package:    runs-on: ubuntu-latest    needs: [contracts, quality]    steps:      - uses: actions/checkout@v4      - name: Build the teaching artifact        run: |          mkdir -p dist          tar -czf dist/alice-sdv-reference.tar.gz edge contracts profiles routes .asw README.md          sha256sum dist/alice-sdv-reference.tar.gz > dist/checksums.sha256      - name: Verify the packaged artifact        run: |          test -s dist/alice-sdv-reference.tar.gz          sha256sum --check dist/checksums.sha256      - name: Store the pipeline artifact        uses: christopherhx/gitea-upload-artifact@v4        with:          name: alice-sdv-reference          path: |            dist/alice-sdv-reference.tar.gz            dist/checksums.sha256          retention-days: 30  deploy-local:    runs-on: ubuntu-latest    needs: [package]    if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'    steps:      - uses: actions/checkout@v4      - name: Retrieve the verified artifact        uses: christopherhx/gitea-download-artifact@v4        with:          name: alice-sdv-reference          path: dist      - name: Activate on the ALICE local simulator        env:          DEPLOY_TOKEN: ${{ secrets.LOCAL_SIMULATOR_DEPLOY_TOKEN }}          ASW_REPOSITORY: ${{ gitea.repository }}          ASW_RUN_ID: ${{ gitea.run_id }}          ASW_COMMIT_SHA: ${{ gitea.sha }}        run: |          CHECKSUM="$(cut -d ' ' -f 1 dist/checksums.sha256)"          VERSION="$(python -c 'import json; print(json.load(open("package/manifest.json"))["version"])')"          curl --fail --silent --show-error --retry 3 \            -X POST \            -H "Authorization: Bearer ${DEPLOY_TOKEN}" \            -H "Content-Type: application/octet-stream" \            -H "X-A-SW-Repository: ${ASW_REPOSITORY}" \            -H "X-A-SW-Run-ID: ${ASW_RUN_ID}" \            -H "X-A-SW-Commit-SHA: ${ASW_COMMIT_SHA}" \            -H "X-A-SW-Artifact-Name: alice-sdv-reference.tar.gz" \            -H "X-A-SW-Checksum: ${CHECKSUM}" \            -H "X-A-SW-Version: ${VERSION}" \            --data-binary @dist/alice-sdv-reference.tar.gz \            http://simulator-target:4300/deployments