Skip to content

Commit

Permalink
Merge pull request #15 from matushorvath/cicd-windows-macos
Browse files Browse the repository at this point in the history
Run CI/CD on Linux, Windows and MacOS
  • Loading branch information
matushorvath authored Mar 5, 2024
2 parents 9fdbd39 + 23efd30 commit 3e331da
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ on:

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
name: OS=${{ matrix.os }}
runs-on: ${{ matrix.os }}

env:
ICDIR: xzintbit
MSBASICDIR: msbasic
FUNCTESTDIR: 6502_65C02_functional_tests

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v4

Expand All @@ -27,6 +31,8 @@ jobs:

- name: Build xzintbit
working-directory: xzintbit
env:
CC: gcc
run: make build-vm

- name: Checkout Microsoft Basic
Expand All @@ -36,11 +42,20 @@ jobs:
path: msbasic

- name: Install cc65
run: sudo apt install -y cc65
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install -y cc65
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install cc65-compiler
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install cc65
fi
shell: bash

- name: Build Microsoft Basic
working-directory: msbasic
run: ./make.sh
shell: bash

- name: Checkout 6502 functional tests
uses: actions/checkout@v4
Expand All @@ -50,6 +65,7 @@ jobs:

- name: Build
run: make build
shell: bash

- name: Test
run: make test
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ MSBASICDIR ?= $(abspath ../msbasic)
FUNCTESTDIR ?= $(abspath ../6502_65C02_functional_tests)

ifeq ($(shell test -d $(ICDIR) || echo error),error)
$(error ICDIR variable is invalid; point it where https://github.com/matushorvath/xzintbit is built)
$(error ICDIR variable is invalid; point it where https://github.com/matushorvath/xzintbit is built)
endif

ifeq ($(shell test -d $(MSBASICDIR) || echo error),error)
$(error MSBASICDIR variable is invalid; point it where https://github.com/matushorvath/msbasic is built)
$(error MSBASICDIR variable is invalid; point it where https://github.com/matushorvath/msbasic is built)
endif

ifeq ($(shell test -d $(FUNCTESTDIR) || echo error),error)
$(error FUNCTESTDIR variable is invalid; point it where https://github.com/Klaus2m5/6502_65C02_functional_tests is cloned)
$(error FUNCTESTDIR variable is invalid; point it where https://github.com/Klaus2m5/6502_65C02_functional_tests is cloned)
endif

ICVM ?= $(abspath $(ICDIR)/vms)/$(ICVM_TYPE)/ic
Expand All @@ -42,7 +42,7 @@ define run-ld
endef

define run-bin2obj
ls -n $< | awk '{ print $$5 }' | cat - $< | $(ICVM) $(BINDIR)/bin2obj.input > $@
ls -n $< | awk '{ printf $$5" " }' | cat - $< | $(ICVM) $(BINDIR)/bin2obj.input > $@ || ( cat $@ ; false )
endef

# Build
Expand Down
4 changes: 2 additions & 2 deletions src/bin2obj.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# db <byte_0>, <byte_1>, ... <byte_size-1> # File data, <size> bytes, each from 0 to 255

# Since Intcode has no way of detecting end of file, this utility expects the file size followed
# by a new line (ASCII 10) to be passed through the standard input before the binary itself.
# by a space to be passed through the standard input before the binary itself.

.IMPORT print_num
.IMPORT print_str
Expand All @@ -20,7 +20,7 @@ read_size_loop:
# Read file size
in [digit]

eq [digit], 10, [tmp]
eq [digit], ' ', [tmp]
jnz [tmp], read_size_done
lt [digit], '0', [tmp]
jnz [tmp], invalid_size
Expand Down

0 comments on commit 3e331da

Please sign in to comment.