[v0.14.0]HIRでコンパイラを作成する #2
This file contains hidden or 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: Cb Compiler CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| - name: Install clang-format | |
| run: sudo apt-get update && sudo apt-get install -y clang-format | |
| - name: Run clang-format | |
| run: make lint | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| - name: Show commit info | |
| run: | | |
| git log -1 --format="%H %s" | |
| echo "Current branch: $(git branch --show-current)" | |
| - name: Install build tools | |
| run: sudo apt-get update && sudo apt-get install -y bison flex g++ | |
| - name: Build | |
| run: make | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cb-build-compiler | |
| path: | | |
| cb | |
| *.o | |
| src/**/*.o | |
| retention-days: 1 | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cb-build-compiler | |
| - name: Make executable | |
| run: chmod +x cb | |
| - name: Install build tools (for test runner and compilation) | |
| run: sudo apt-get update && sudo apt-get install -y g++ | |
| - name: Run unit tests (make unit-test) | |
| run: make unit-test | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cb-build-compiler | |
| - name: Make executable | |
| run: chmod +x cb | |
| - name: Install build tools (for compilation) | |
| run: sudo apt-get update && sudo apt-get install -y g++ | |
| - name: Run integration tests via compiler (make integration-test-compiler) | |
| run: make integration-test-compiler | |
| stdlib-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cb-build-compiler | |
| - name: Make executable | |
| run: chmod +x cb | |
| - name: Install build tools (for compilation) | |
| run: sudo apt-get update && sudo apt-get install -y g++ | |
| - name: Run stdlib tests via compiler (make stdlib-cb-test-compiler) | |
| run: make stdlib-cb-test-compiler |