Fix main branch name in action #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: go build -buildmode=c-shared -o hello.so ./hello | |
| - name: Run Python script | |
| run: python hello/hello.py > output.txt | |
| - name: Check output | |
| run: | | |
| if [ "$(cat output.txt)" == "" ]; then | |
| echo "Output is correct" | |
| else | |
| echo "Output is incorrect" | |
| exit 1 | |
| fi |