Skip to content

Expand action coverage #3

Expand action coverage

Expand action coverage #3

Workflow file for this run

name: Compile Go and run Python
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Build Go code
run: |
for x in hello primitive; do
go build -buildmode=c-shared -o $x.so ./$x
done
- name: Run Python script
run: |
for x in hello primitive; do
python $x/$x.py > $x.out
done
- name: Check output
run: |
if [ "$(cat hello.out)" != "Hello world!" ]; then
echo "Output is incorrect:"
printf '%q\n' "$(cat hello.out)"
exit 1
fi
if [ "$(cat primitive.out)" != "10 + 15 = 25" ]; then
echo "Output is incorrect:"
printf '%q\n' "$(cat primitive.out)"
exit 1
fi