summaryrefslogtreecommitdiff
path: root/.github/workflows/core-checks.yml
blob: c755d6d72db39e70231f5b4db880c9556303ad27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Core-Checker

on: [pull_request]

jobs:
  core-checker:
    name: FreeRTOS Core Checks
    runs-on: ubuntu-latest
    steps:
      # Install python 3
      - name: Tool Setup
        uses: actions/setup-python@v2
        with:
          python-version: 3.7.10
          architecture:   x64
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      # Use the checks as defined by the user, so they can locally adjust as needed
      - name: Checkout FreeRTOS Tools
        uses: actions/checkout@v2
        with:
          ref:  ${{ github.event.pull_request.head.sha }}
          path: tools

      # Checkout user pull request changes
      - name: Checkout Pull Request
        uses: actions/checkout@v2
        with:
          ref:  ${{ github.event.pull_request.head.sha }}
          path: inspect

      # Collect all affected files
      - name: Collecting changed files
        uses: lots0logs/gh-action-get-changed-files@2.1.4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      # Run checks
      - name: Check File Headers
        run: |
          cd inspect
          pip install -r .github/scripts/common/requirements.txt
          export PYTHONPATH=tools/.github/scripts:${PYTHONPATH}
          .github/scripts/core_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
          exit $?
  build-checker:
    name: FreeRTOS Posix Build Check
    runs-on: ubuntu-latest
    steps:
      - name: Clone This Repo
        uses: actions/checkout@v2
        with:
            path: ./workspace
            submodules: 'recursive'
            fetch-depth: 1
      - name: Posix Build Checker
        run: |
            bash workspace/.github/scripts/posix_build_checker.sh workspace
      - name: Install lib pcap dev
        run: |
          sudo apt-get install libpcap-dev
      - name: Posix Network Build Checker
        run: |
            bash workspace/.github/scripts/posix_network_build_checker.sh workspace