Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dm/ci testing #410

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,11 @@ jobs:

# Pulls the latest image to try to re-use some layers
- name: Pull Latest Docker image
run: |
docker pull artifactory.galois.com:5025/pate/pate:${GITHUB_REF//\//\-} || \
docker pull artifactory.galois.com:5025/pate/pate:refs-heads-master || \
echo "No latest image found"
run: echo "No latest image found"

- name: Build Docker Image
run: |
docker build . \
--cache-from artifactory.galois.com:5025/pate/pate:${GITHUB_REF//\//\-} \
--cache-from artifactory.galois.com:5025/pate/pate:refs-heads-master \
-t pate
docker build . -t pate

- name: Test Docker Image
run: |
Expand Down Expand Up @@ -101,7 +95,9 @@ jobs:
name: Restore GHCup
id: cache-ghcup
with:
path: ~/.ghcup
path: |
~/.ghcup
~/.cabal
key: ${{ env.CACHE_VERSION }}-pate-ghcup-${{ runner.os }}-${{ matrix.ghc }}

- uses: haskell-actions/setup@v2
Expand All @@ -114,7 +110,9 @@ jobs:
- uses: actions/cache/save@v4
name: Save GHCup
with:
path: ~/.ghcup
path: |
~/.ghcup
~/.cabal
key: ${{ steps.cache-ghcup.outputs.cache-primary-key }}

- name: System Dependencies
Expand Down
1 change: 1 addition & 0 deletions tests/.programtargets
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6210ba50cfb764e439d3e8236c05aad688b027b8
1 change: 0 additions & 1 deletion tests/aarch32/.programtargets

This file was deleted.

21 changes: 21 additions & 0 deletions tests/ppc32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,25 @@ CC=powerpc-linux-gnu-gcc
OD=powerpc-linux-gnu-objdump
EXTRA_TARGETS=

ifeq (,$(wildcard $(CHALLENGE_DIR)))
else

EXTRA_TARGETS+=scripted/target1

scripted/target1.%: ../.programtargets
$(call fetch,target1)

endif

.PHONY: scripted/target1

scripted:
mkdir -p scripted

scripted/target1: scripted scripted/target1.original.exe scripted/target1.args scripted/target1.pate

scripted/target1.script_run: scripted/target1
cd scripted; \
../../../pate.sh $(shell cat scripted/target1.args)

include ../template.mk
1 change: 1 addition & 0 deletions tests/ppc32/scripted/target1.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Equivalent
4 changes: 4 additions & 0 deletions tests/template.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.PHONY: all extras

define fetch
(((cd $(CHALLENGE_DIR) && git show $(shell cat ../.programtargets):tests/$1/$(notdir $@)) > $@) || (rm -f $@ && exit 1))
endef

extras: ${EXTRA_TARGETS}

all: $(notdir $(patsubst %original.c,%test,$(wildcard ../src/*.original.c))) $(addprefix ./build/,$(notdir $(patsubst %c,%i,$(wildcard ../src/*.c)))) extras
Expand Down
Loading