Update default permissions in GH actions (#35) #29
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: General | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Top-level default, no permissions | |
permissions: {} | |
jobs: | |
run-checks: | |
name: Run Checks | |
permissions: {} | |
timeout-minutes: 30 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Lint Markdown files | |
uses: DavidAnson/markdownlint-cli2-action@v11 | |
with: | |
globs: '**/*.md' | |
- name: Check Markdown links | |
uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
with: | |
use-quiet-mode: yes # output is too noisy, see https://github.com/gaurav-nelson/github-action-markdown-link-check/issues/121 | |
config-file: .github/configs/mlc_config.json | |
- name: Setup Dart | |
uses: dart-lang/setup-dart@v1 | |
- name: Install Dart dependencies | |
run: tool/gh_actions/install_dart_dependencies.sh | |
- name: Verify dart formatting | |
run: tool/gh_actions/verify_dart_formatting.sh | |
- name: Analyze dart source | |
run: tool/gh_actions/analyze_dart_source.sh | |
- name: Check project documentation | |
run: tool/gh_actions/check_documentation.sh | |
- name: Install software - Icarus Verilog | |
run: tool/gh_actions/install_iverilog.sh | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
- name: Install software - Python dependencies | |
run: tool/gh_actions/install_python_dependencies.sh | |
- name: Verify python formatting | |
run: tool/gh_actions/verify_python_formatting.sh | |
- name: Analyze python source | |
run: tool/gh_actions/analyze_python_source.sh | |
- name: Run project tests | |
run: tool/gh_actions/run_tests.sh | |
- name: Check folder - tmp_* | |
run: tool/gh_actions/check_folder_tmp_test.sh | |
# https://github.com/devcontainers/ci/blob/main/docs/github-action.md | |
- name: Build dev container and run tests in it | |
uses: devcontainers/ci@v0.3 | |
with: | |
runCmd: tool/gh_actions/run_tests.sh | |
deploy-documentation: | |
name: Deploy Documentation | |
needs: run-checks | |
if: github.event_name == 'push' | |
permissions: | |
contents: write # required for "JamesIves/github-pages-deploy-action" | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Dart | |
uses: dart-lang/setup-dart@v1 | |
- name: Install dart dependencies | |
run: tool/gh_actions/install_dart_dependencies.sh | |
- name: Generate project documentation | |
run: tool/gh_actions/generate_documentation.sh | |
- name: Deploy generated documentation | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: doc/api | |
branch: docs |