Skip to content

Commit

Permalink
wip changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishkeshan committed Mar 25, 2024
1 parent 9f1b116 commit 9e13094
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ jobs:
input: "from stdin"
expected-output: "from stdin"
comparison-method: "contains"
- uses: ./
id: make-test
with:
test-name: "make test"
setup-command: make
command: ./hellomake
expected-output: "Hello makefiles!"
comparison-method: "exact"
- name: Decode and assert echo-test
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -55,3 +63,17 @@ jobs:
json["tests"][0]["test_code"] != 'cat <stdin>from stdin') {
throw new Error(`Assertion failed. Expected 'expected value', but got '${decodedResult}'`);
}
- name: Decode and assert make-test
uses: actions/github-script@v6
with:
github-token: 123
script: |
// Decode the Base64 output
const decodedResult = Buffer.from("${{ steps.make-test.outputs.result }}", 'base64').toString('utf8');
console.log(`Decoded Result: ${decodedResult}`);
const json = JSON.parse(decodedResult)
if ( json["version"] != 1 &&
json["status"] != "pass" &&
json["tests"][0]["name"] != "echo test") {
throw new Error(`Assertion failed. Expected 'expected value', but got '${decodedResult}'`);
}
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hellomake: hellomake.c hellofunc.c
gcc -o hellomake hellomake.c hellofunc.c -I.
9 changes: 9 additions & 0 deletions hellofunc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>
#include <hellomake.h>

void myPrintHelloMake(void) {

printf("Hello makefiles!\n");

return;
}
8 changes: 8 additions & 0 deletions hellomake.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <hellomake.h>

int main() {
// call a function in another file
myPrintHelloMake();

return(0);
}
5 changes: 5 additions & 0 deletions hellomake.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
example include file
*/

void myPrintHelloMake(void);
7 changes: 5 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ function run() {
inputs = getInputs()

if (inputs.setupCommand) {
spawn(inputs.setupCommand, {
shell: true,
console.log(inputs.setupCommand)
const val = execSync(inputs.setupCommand, {
timeout: inputs.timeout,
stdio: 'inherit',
env,
})
// console.log(val.toString())
}

const startTime = new Date()
Expand Down

0 comments on commit 9e13094

Please sign in to comment.