Updates README #9
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: Creation of Artifact Docker Image | |
on: | |
push: | |
jobs: | |
build-verify: | |
runs-on: ubuntu-latest | |
timeout-minutes: 90 | |
env: | |
IMAGE_NAME: securityprotocolimplementations-artifact | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Create Image ID | |
run: | | |
REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
echo "IMAGE_ID=ghcr.io/$REPO_OWNER/${{ env.IMAGE_NAME }}" >>$GITHUB_ENV | |
- name: Image version | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[ "$VERSION" == "main" ] && VERSION=latest | |
echo "IMAGE_TAG=${{ env.IMAGE_ID }}:$VERSION" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
file: docker/Dockerfile | |
tags: ${{ env.IMAGE_TAG }} | |
labels: "runnumber=${{ github.run_id }}" | |
push: false | |
cache-from: type=gha, scope=${{ github.workflow }} | |
cache-to: type=gha, scope=${{ github.workflow }} | |
- name: Test NSL | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/test-nsl.sh" | |
- name: Test DH | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/test-dh.sh" | |
- name: Test WireGuard | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/test-wireguard.sh" | |
- name: Test C NSL | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/test-c-nsl.sh" | |
- name: Verify reusable verification library | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-library.sh" | |
- name: Verify C reusable verification library | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-c-library.sh" | |
- name: Verify NSL | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-nsl.sh" | |
- name: Verify NSL (alt.) | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-nsl-alternative.sh" | |
- name: Verify DH | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-dh.sh" | |
- name: Verify WireGuard | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-wireguard.sh" | |
- name: Verify C NSL | |
run: docker run --entrypoint "/bin/bash" ${{ env.IMAGE_TAG }} -c "cp -r Go-orig/. Go/; cp -r C-orig/. C/; /gobra/verify-c-nsl.sh" | |
- name: Login to Github Packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: docker/Dockerfile | |
tags: ${{ env.IMAGE_TAG }} | |
labels: "runnumber=${{ github.run_id }}" | |
push: true | |
cache-from: type=gha, scope=${{ github.workflow }} | |
cache-to: type=gha, scope=${{ github.workflow }} |