Skip to content

fixed

fixed #9

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
working-directory: ${{ github.workspace }}
- name: Move executable to appropriate directory (Linux/macOS)
if: runner.os != 'Windows'
run: |
mkdir -p ${{ env.BUILD_DIR }}/ubuntu ${{ env.BUILD_DIR }}/macos
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/ubuntu/largeintcalculator
mv ${{ env.BUILD_DIR }}/largeintcalculator ${{ env.BUILD_DIR }}/macos/largeintcalculator
working-directory: ${{ github.workspace }}
- name: Move executable to appropriate directory (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p ${{ env.BUILD_DIR }}/windows
mv ${{ env.BUILD_DIR }}/largeintcalculator.exe ${{ env.BUILD_DIR }}/windows/largeintcalculator.exe
working-directory: ${{ github.workspace }}