Skip to content

Use CMakeLists.txt instead of Makefile #30

Use CMakeLists.txt instead of Makefile

Use CMakeLists.txt instead of Makefile #30

Workflow file for this run

name: Docker Build and Test
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache build directory
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-
- name: Set lowercase repository owner
id: repo_owner
run: echo "::set-output name=owner::${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: ghcr.io/${{ steps.repo_owner.outputs.owner }}/build_test:latest
- name: Extract build directory from Docker image
run: |
container_id=$(docker create ghcr.io/${{ steps.repo_owner.outputs.owner }}/build_test:latest)
docker cp $container_id:/rawhash2/build ./build
docker rm $container_id
- name: Run Docker container
run: docker run --rm ghcr.io/${{ steps.repo_owner.outputs.owner }}/build_test:latest -h