pocketlang/.github/workflows/build.yml
Alexander Patel 90f95391b3 Makefile: compile objects individually, then link
This commit updates the Makefile to complile each .c source file into
an object before linking. The benefit of this is that only the necessary
files will be recompiled when modifying the code.

We also move the Makefile and build.bat up to the root directory of the
repo. This is so that calling make directly builds the binaries.
Both files are updated to adapt to the new directory structure.

With this change, initial build times are increased from ~3s to ~10s on
my machine. However, subsequent build times are improved.

As a result of this change, SConstruct is somewhat deprecated. We can
update this as well if necessary in a future change.

I verified that the build completes successfully and tests pass for
both ubuntu and windows 10.

A future change could compile src/ files into a static library to be
linked with cli/, if necessary.

Issue: #64
2021-06-17 00:56:09 -07:00

52 lines
1.1 KiB
YAML

name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
## Check for trailing white space, line width, tabs, etc.
style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run check.py script.
run: |
python3 tests/check.py
## Compile and run test on linux system.
linux-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run the Makefile.
run: |
make all
- name: Run tests.
run: |
python3 tests/tests.py
## Compile and run tests on windows system.
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Run build batch script.
run: |
cmd /c build.bat
- name: Run tests.
run: |
python3 tests/tests.py
## Compile and run tests on macos system.
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Run the Makefile.
run: |
make all
- name: Run tests.
run: |
python3 tests/tests.py