Merge pull request #34 from codecrafters-io/add-branch #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.22.x | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.11' | |
- name: Set up OpenJDKv22 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '22' | |
distribution: 'adopt' | |
- name: Fetch jlox official implementation | |
run: git clone https://github.com/munificent/craftinginterpreters.git | |
- name: Set up Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: 2.19.6 | |
- name: Get Dart dependencies | |
run: cd craftinginterpreters && make get | |
- name: Minor updates to official implementation | |
# We update the Scanner class to print the unexpected character along with the error message | |
run: | | |
sed -i 's/Lox\.error(line, "Unexpected character\.");/Lox\.error(line, "Unexpected character: " + c);/g' craftinginterpreters/java/com/craftinginterpreters/lox/Scanner.java | |
- name: Compile jlox | |
run: | | |
cd craftinginterpreters | |
make java_chapters | |
cd .. | |
cp -r ./internal/test_helpers/jlox04/* ./craftinginterpreters/build/gen/chap04_scanning | |
cp -r ./internal/test_helpers/jlox06/* ./craftinginterpreters/build/gen/chap06_parsing | |
cp -r ./internal/test_helpers/jlox07/* ./craftinginterpreters/build/gen/chap07_evaluating | |
cp -r ./internal/test_helpers/jlox08/* ./craftinginterpreters/build/gen/chap08_statements | |
- run: make test |