Skip to content

fixed

fixed #7

Workflow file for this run

name: "Build and Test"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_DIR: builds
jobs:
build-and-test:
strategy:
matrix:
os-version: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up C/C++ compiler
id: setup_compiler
uses: rlalik/setup-cpp-compiler@master
with:
compiler: gcc-latest
- name: Compile and build executable
run: |
gcc -o ${{ env.BUILD_DIR }}/largeintcalculator largeintcalculator.c
# On Windows, rename the executable to .exe
if [[ "$RUNNER_OS" == "Windows" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator.exe ${{ env.BUILD_DIR }}/windows
elif [[ "$RUNNER_OS" == "Linux" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/ubuntu
elif [[ "$RUNNER_OS" == "macOS" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/macos
fi
working-directory: ${{ github.workspace }}
- name: Move executable to appropriate directory
run: |
mkdir -p ${{ env.BUILD_DIR }}/windows ${{ env.BUILD_DIR }}/ubuntu ${{ env.BUILD_DIR }}/macos
if [[ "$RUNNER_OS" == "Windows" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator.exe ${{ env.BUILD_DIR }}/windows
elif [[ "$RUNNER_OS" == "Linux" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/ubuntu
elif [[ "$RUNNER_OS" == "macOS" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/macos
fi
run: |

Check failure on line 51 in .github/workflows/macos.yml

View workflow run for this annotation

GitHub Actions / Build and Test

Invalid workflow file

The workflow is not valid. .github/workflows/macos.yml (Line: 51, Col: 9): 'run' is already defined
mkdir -p ${{ env.BUILD_DIR }}/windows ${{ env.BUILD_DIR }}/ubuntu ${{ env.BUILD_DIR }}/macos
if [[ "$RUNNER_OS" == "Windows" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator.exe ${{ env.BUILD_DIR }}/windows
elif [[ "$RUNNER_OS" == "Linux" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/ubuntu
elif [[ "$RUNNER_OS" == "macOS" ]]; then
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/macos
fi
working-directory: ${{ github.workspace }}