Skip to content

ci: sconification

ci: sconification #54

Workflow file for this run

name: Rust CI

Check failure on line 1 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

(Line: 68, Col: 9): Unexpected value 'secrets', (Line: 49, Col: 5): Required property is missing: runs-on, (Line: 110, Col: 9): Unexpected value 'secrets', (Line: 91, Col: 5): Required property is missing: runs-on
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
jobs:
build-and-test:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
rust-version: '1.88.0'
working-directory: "."
enable-cache: true
publish-crates-io: false
prepare:
name: Determine image tag
runs-on: ubuntu-latest
needs: build-and-test
if: |
github.ref_name == 'main' ||
startsWith(github.head_ref, 'feature/') ||
startsWith(github.head_ref, 'bugfix/') ||
(github.event_name == 'workflow_dispatch' && (startsWith(github.ref_name, 'feature/') || startsWith(github.ref_name, 'bugfix/')))
outputs:
image_tag: ${{ steps.determine-tag.outputs.image_tag }}
steps:
- name: Determine Docker tag based on Git ref
id: determine-tag
run: |
if [ "${{ github.event_name }}" = "pull_request" ] ; then
SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8)
else
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
fi
if [ "${{ github.ref_name }}" = "main" ] ; then
echo "Processing main branch"
echo "image_tag=dev-${SHORT_SHA}" | tee -a $GITHUB_OUTPUT
else
# This covers feature/ and bugfix/ branches
echo "Processing feature/bugfix branch ${{ github.head_ref }}"
echo "image_tag=feature-${SHORT_SHA}" | tee -a $GITHUB_OUTPUT
fi
post-compute-oci-image:
name: post-compute OCI image
needs: prepare
env:
IMG_FROM: docker-regis.iex.ec/tee-worker-post-compute-rust:${{ needs.prepare.outputs.image_tag }}
IMG_TO: docker-regis.iex.ec/tee-worker-post-compute-rust-unlocked:${{ needs.prepare.outputs.image_tag }}-sconify-5.9.1-debug
steps:
- name: native
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
image-name: docker-regis.iex.ec/tee-worker-post-compute-rust
image-tag: ${{ needs.prepare.outputs.image_tag }}
dockerfile: post-compute/Dockerfile
context: .
registry: docker-regis.iex.ec
push: true
security-scan: true
security-report: "sarif"
hadolint: true
platforms: linux/amd64
secrets:
username: ${{ secrets.NEXUS_USERNAME }}
password: ${{ secrets.NEXUS_PASSWORD }}
- name: Login to Scontain registry
uses: docker/login-action@v3
with:
registry: registry.scontain.com
username: ${{ secrets.SCONTAIN_REGISTRY_USERNAME }}
password: ${{ secrets.SCONTAIN_REGISTRY_PAT }}
- name: Sconify
run: pre-compute/scone/sconify.sh
- name: Login to Docker regis
uses: docker/login-action@v3
with:
registry: docker-regis.iex.ec
username: ${{ secrets.NEXUS_USERNAME }}
password: ${{ secrets.NEXUS_PASSWORD }}
- name: Publish
run: docker push $IMG_TO
- name: Clean
run: docker image rm -f $IMG_FROM $IMG_TO registry.scontain.com/scone-debug/iexec-sconify-image-unlocked:5.9.1
pre-compute-oci-image:
name: pre-compute OCI image
needs: prepare
env:
IMG_FROM: docker-regis.iex.ec/tee-worker-pre-compute-rust:${{ needs.prepare.outputs.image_tag }}
IMG_TO: docker-regis.iex.ec/tee-worker-pre-compute-rust-unlocked:${{ needs.prepare.outputs.image_tag }}-sconify-5.9.1-debug
steps:
- name: native
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
image-name: docker-regis.iex.ec/tee-worker-pre-compute-rust
image-tag: ${{ needs.prepare.outputs.image_tag }}
dockerfile: pre-compute/Dockerfile
context: .
registry: docker-regis.iex.ec
push: true
security-scan: true
security-report: "sarif"
hadolint: true
platforms: linux/amd64
secrets:
username: ${{ secrets.NEXUS_USERNAME }}
password: ${{ secrets.NEXUS_PASSWORD }}
- name: Login to Scontain registry
uses: docker/login-action@v3
with:
registry: registry.scontain.com
username: ${{ secrets.SCONTAIN_REGISTRY_USERNAME }}
password: ${{ secrets.SCONTAIN_REGISTRY_PAT }}
- name: Sconify
run: post-compute/scone/sconify.sh
- name: Login to Docker regis
uses: docker/login-action@v3
with:
registry: docker-regis.iex.ec
username: ${{ secrets.NEXUS_USERNAME }}
password: ${{ secrets.NEXUS_PASSWORD }}
- name: Publish
run: docker push $IMG_TO
- name: Clean
run: docker image rm -f $IMG_FROM $IMG_TO registry.scontain.com/scone-debug/iexec-sconify-image-unlocked:5.9.1