Skip to content

Commit

Permalink
Create docker image for the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrakisk committed Oct 9, 2024
1 parent dd47ff3 commit 52fa05f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/actions/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Docker'
description: 'Installs dependencies in a docker container that will be used in workflows'
runs:
using: 'docker'
image: './docker/Dockerfile'
args:
- ${{ inputs.script }}

inputs:
script:
description: 'The script to run inside the container.'
required: true
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
# - name: Build
# run: cargo build --verbose
# - name: Run tests
# run: cargo test --verbose
- name: Test
uses: ./actions/docker.yml
with:
script: |
cargo build --verbose
cargo test --verbose
12 changes: 12 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ubuntu 22.04
FROM ubuntu@sha256:3d1556a8a18cf5307b121e0a98e93f1ddf1f3f8e092f1fddfd941254785b95d7

RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt-get install -qy --no-install-recommends \
libsdl2-dev

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
6 changes: 6 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

SCRIPT=$1

eval "$SCRIPT"

0 comments on commit 52fa05f

Please sign in to comment.