diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86ef6fa4..7422669c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,29 +37,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v4 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.9' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt - - name: Install PlatformIO + - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade platformio + pip install -r .github/workflows/requirements.txt - name: Compile ${{ matrix.environment }} firmware run: platformio run --environment ${{ matrix.environment }} @@ -77,29 +64,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v4 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.9' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt - - name: Install PlatformIO + - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade platformio + pip install -r .github/workflows/requirements.txt - name: Perform static checks on ${{ matrix.environment }} run: platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high @@ -114,29 +88,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v4 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.9' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt - - name: Install PlatformIO + - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade platformio + pip install -r .github/workflows/requirements.txt - name: Run tests on native environment run: platformio test --environment TestSim -vvv @@ -154,29 +115,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v4 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.9' - - - name: Install PlatformIO + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt + + - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade platformio + pip install -r .github/workflows/requirements.txt - name: Set up graphviz uses: ts-graphviz/setup-graphviz@v2 @@ -196,23 +144,22 @@ jobs: # The type of runner that the job will run on. runs-on: ubuntu-latest needs: intro - strategy: - matrix: - python-version: ["3.9", "3.10", "3.11"] # Steps represent a sequence of tasks that will be executed as part of the job. steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - + python-version: '3.9' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt + - name: Install dependencies run: | - pip install pylint + pip install -r .github/workflows/requirements.txt - name: Analysing the code with pylint run: | diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt new file mode 100644 index 00000000..2c15021d --- /dev/null +++ b/.github/workflows/requirements.txt @@ -0,0 +1,3 @@ +platformio==6.1.15 +pylint==3.2.6 +SerialMuxProt @ git+https://github.com/gabryelreyes/SerialMuxProt.git@10270033b0eb5e19cae39c35978745a778eb6acc#subdirectory=python/SerialMuxProt \ No newline at end of file