Add ML for synthesis prototype to repository #173
Workflow file for this run
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: NITTA Build and Test | |
on: | |
pull_request: | |
push: | |
branches: master | |
env: | |
GH_PAGES_DIR: gh-pages | |
jobs: | |
notify-about-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send msg on push | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: html | |
args: | | |
Repository: <strong>${{ github.event.repository.full_name }}</strong> | |
Ref: <strong>${{ github.ref }}</strong> | |
Event: <strong>${{ github.event_name }}</strong> | |
Info: ${{ github.event.pull_request.title }} | |
${{ github.event.pull_request.html_url }} | |
nitta-haskell-deps: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache haskell-stack | |
uses: actions/cache@v3.2.5 | |
with: | |
path: | | |
~/.stack | |
.stack-work | |
/home/runner/.local/bin | |
key: ${{ runner.os }}-haskell-stack-${{ hashFiles('**/stack.yaml', '**/package.yaml') }} | |
- name: Install haskell-stack | |
uses: haskell/actions/setup@v2.4.3 | |
with: | |
enable-stack: true | |
stack-no-global: true | |
stack-version: "latest" | |
- name: Build nitta backend dependencies and doctest | |
run: | | |
stack build --haddock --test --only-dependencies | |
stack install doctest | |
- name: Install weeder | |
run: stack install weeder-2.4.1 | |
nitta: | |
runs-on: ubuntu-latest | |
needs: nitta-haskell-deps | |
timeout-minutes: 45 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache haskell-stack | |
uses: actions/cache@v3.2.5 | |
with: | |
path: | | |
~/.stack | |
.stack-work | |
/home/runner/.local/bin | |
key: ${{ runner.os }}-haskell-stack-${{ hashFiles('**/stack.yaml', '**/package.yaml') }} | |
- name: Install haskell-stack | |
uses: haskell/actions/setup@v2.3.3 | |
with: | |
enable-stack: true | |
stack-no-global: true | |
stack-version: "latest" | |
- name: Install Icarus Verilog | |
run: sudo apt-get install iverilog | |
- name: Build & test nitta backend | |
run: stack build --haddock --no-haddock-deps --test --keep-going --test-suite-timeout 600 --copy-bins --coverage | |
- name: Generate test coverage report | |
run: stack hpc report nitta | |
- name: Check examples by doctest | |
run: find src -name '*.hs' -exec grep -l '>>>' {} \; | xargs -t -L 1 -P 4 stack exec doctest | |
- name: Generate backend API | |
run: stack exec nitta-api-gen -- -v | |
- name: Cache node_modules | |
uses: actions/cache@v3.2.5 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Build nitta frontend dependencies | |
working-directory: ./web | |
run: yarn install | |
- name: Build frontend | |
working-directory: ./web | |
timeout-minutes: 5 | |
run: yarn build | |
- name: Run weeder | |
run: weeder | |
- name: Copy doc to GH_PAGES_DIR | |
run: | | |
mkdir -p "${{ env.GH_PAGES_DIR }}/haddock/" | |
cp -r $(stack path --dist-dir)/doc/html/nitta "$_" | |
- name: Copy test coverage to GH_PAGES_DIR | |
run: cp -r $(stack path --local-hpc-root)/combined/custom ${{ env.GH_PAGES_DIR }}/hpc | |
- name: Copy API doc to GH_PAGES_DIR | |
run: | | |
mkdir -p "${{ env.GH_PAGES_DIR }}/rest-api/" | |
cp ./web/src/services/gen/rest_api.markdown "$_" | |
- name: Copy README.md to GH_PAGES_DIR | |
run: cp README.md ${{ env.GH_PAGES_DIR }}/ | |
- name: Publish generated content to GitHub Pages | |
if: ${{ github.ref == 'refs/heads/master'}} | |
uses: JamesIves/github-pages-deploy-action@v4.4.1 | |
with: | |
folder: ${{ env.GH_PAGES_DIR }} | |
branch: gh-pages | |
verilog-formatting: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
container: ryukzak/alpine-iverilog | |
defaults: | |
run: | |
shell: sh | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
make -C hdl > make_hdl.log | |
cat make_hdl.log | |
test "$(grep -ci error make_hdl.log)" -eq 0 | |
haskell-lint: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Set up HLint" | |
uses: haskell/actions/hlint-setup@v2.3.3 | |
with: | |
version: "3.5" | |
- name: "Run HLint" | |
uses: haskell/actions/hlint-run@v2.3.3 | |
with: | |
path: . | |
fail-on: suggestion | |
haskell-formatting: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check formatting | |
uses: fourmolu/fourmolu-action@v8 # fourmolu-0.12.0.0 | |
typescript-formatting: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check ts and tsx code style by prettier | |
working-directory: ./web | |
run: | | |
yarn add -s prettier | |
yarn exec -s prettier -- --check src/**/*.{ts,tsx} | |
markdown-formatting: | |
timeout-minutes: 5 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3.2.0 | |
- name: Run mdl for check markdown format | |
uses: nosborn/github-action-markdown-cli@v3.3.0 | |
with: | |
files: . | |
config_file: .markdownlint.yaml |