Skip to content

Commit

Permalink
Merge pull request #116 from savi-lang/add/github-actions
Browse files Browse the repository at this point in the history
Add GitHub Actions for CI.
  • Loading branch information
jemc authored Aug 6, 2021
2 parents 3218127 + fe949e7 commit 2154d8c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
15 changes: 1 addition & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
version: 2.1

workflows:
build:
jobs:
- build
tooling-vscode-publish:
jobs:
- tooling-vscode-publish:
filters: { branches: { only: [main] } }

# TODO: Move this job to GitHub Actions:
jobs:
build:
machine: true
steps:
- checkout
- run:
name: Build and run the development environment container.
command: make ready
- run:
name: Run the CI suite.
command: make ci

tooling-vscode-publish:
executor: node
steps:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Savi
on: [push]
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Prepare Dependencies
run: make ready

- name: Full CI Suite
run: make ci
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ci: PHONY

# Run the test suite.
test: PHONY
docker exec -ti savi-dev make extra_args="$(extra_args)" test.inner
docker exec savi-dev make extra_args="$(extra_args)" test.inner
/tmp/bin/spec: $(shell find lib -name '*.cr') $(shell find src -name '*.cr') $(shell find spec -name '*.cr')
mkdir -p /tmp/bin
crystal build --debug spec/all.cr -o $@
Expand All @@ -26,7 +26,7 @@ test.inner: PHONY /tmp/bin/spec

# Run a narrow target within the test suite.
test.narrow: PHONY
docker exec -ti savi-dev make target="$(target)" extra_args="$(extra_args)" test.narrow.inner
docker exec savi-dev make target="$(target)" extra_args="$(extra_args)" test.narrow.inner
test.narrow.inner: PHONY
crystal spec spec/spec_helper.cr "$(target)" $(extra_args)

Expand All @@ -52,29 +52,29 @@ format.inner: PHONY /tmp/bin/savi

# Evaluate a Hello World example.
example-eval: PHONY
docker exec -ti savi-dev make extra_args="$(extra_args)" example-eval.inner
docker exec savi-dev make extra_args="$(extra_args)" example-eval.inner
example-eval.inner: PHONY /tmp/bin/savi
echo && /tmp/bin/savi eval 'env.out.print("Hello, World!")'

# Run the files in the given directory.
example-run: PHONY
docker exec -ti savi-dev make dir="$(dir)" extra_args="$(extra_args)" example-run.inner
docker exec savi-dev make dir="$(dir)" extra_args="$(extra_args)" example-run.inner
example-run.inner: PHONY /tmp/bin/savi
echo && cd "/opt/code/$(dir)" && /tmp/bin/savi run $(extra_args)

# Compile the files in the given directory.
example-compile: PHONY
docker exec -ti savi-dev make dir="$(dir)" extra_args="$(extra_args)" example-compile.inner
docker exec savi-dev make dir="$(dir)" extra_args="$(extra_args)" example-compile.inner
example-compile.inner: PHONY /tmp/bin/savi
echo && cd "/opt/code/$(dir)" && /tmp/bin/savi $(extra_args)

# Compile and run the savi binary in the given directory.
example: example-compile
echo && docker exec -ti savi-dev "$(dir)/main" || true
echo && docker exec savi-dev "$(dir)/main" || true
example-lldb: example-compile
echo && lldb -o run -- "$(dir)/main" # TODO: run this within docker when alpine supports lldb package outside of edge
example-savi-callgrind: PHONY
docker exec -ti savi-dev make extra_args="$(extra_args)" example-savi-callgrind.inner
docker exec savi-dev make extra_args="$(extra_args)" example-savi-callgrind.inner
/tmp/bin/savi: main.cr $(shell find lib -name '*.cr') $(shell find src -name '*.cr')
mkdir -p /tmp/bin
crystal build --debug main.cr --error-trace -o $@
Expand Down

0 comments on commit 2154d8c

Please sign in to comment.