From 2313480e115d99b94a00dc3c19b53b731c2a31e0 Mon Sep 17 00:00:00 2001 From: Tim Huyeng Date: Thu, 27 Oct 2022 12:34:43 +0200 Subject: [PATCH 1/5] added build workflow --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..e6a1457c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: PlatformIO CI + +on: + pull_request: + push: + # branches: + # - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Cache PlatformIO + uses: actions/cache@v2 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.9.15" + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + - run: ls + - name: Copy of necessary files + run: | + cp platformio_orig.ini platformio.ini + cp src/loraconf_sample.h src/loraconf.h + cp src/ota_sample.conf src/ota.conf + cp src/paxcounter_orig.conf src/paxcounter.conf + - run: ls + + - name: Run PlatformIO + run: pio run From a2d93ef0e450809774b73182dd47253c41f4bc33 Mon Sep 17 00:00:00 2001 From: Tim Huyeng Date: Thu, 27 Oct 2022 13:11:50 +0200 Subject: [PATCH 2/5] updatet versions of actions and added os-matrix --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6a1457c..9347d009 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,38 +8,39 @@ on: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.9.15" - name: Install PlatformIO run: | python -m pip install --upgrade pip pip install --upgrade platformio - - run: ls - name: Copy of necessary files run: | cp platformio_orig.ini platformio.ini cp src/loraconf_sample.h src/loraconf.h cp src/ota_sample.conf src/ota.conf cp src/paxcounter_orig.conf src/paxcounter.conf - - run: ls - - name: Run PlatformIO run: pio run From a900ea2e7e2955f7e09e826212f7af37b8a27486 Mon Sep 17 00:00:00 2001 From: Tim Huyeng Date: Thu, 27 Oct 2022 13:20:19 +0200 Subject: [PATCH 3/5] changed python version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9347d009..534b8e28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.9.15" + python-version: "3.9.13" - name: Install PlatformIO run: | python -m pip install --upgrade pip From c72a6f78f1cf52871bf52f3d5749daa5f29e176e Mon Sep 17 00:00:00 2001 From: Tim Huyeng Date: Thu, 27 Oct 2022 13:34:26 +0200 Subject: [PATCH 4/5] run only on push for master --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 534b8e28..26844765 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,8 @@ name: PlatformIO CI on: pull_request: push: - # branches: - # - master + branches: + - master jobs: build: From 4a7d005fc889bc2a8b4f470886ad97caf7efce6b Mon Sep 17 00:00:00 2001 From: Tim Huyeng Date: Thu, 27 Oct 2022 13:57:15 +0200 Subject: [PATCH 5/5] update cache paths --- .github/workflows/build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26844765..87da98e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] + include: + - os: ubuntu-latest + path: ~/.cache/pip + platformio-path: ~/.platformio + - os: macos-latest + path: ~/Library/Caches/pip + platformio-path: ~/Library/Caches/platformio + - os: windows-latest + path: ~\AppData\Local\pip\Cache + platformio-path: ~\AppData\Local\platformio\Cache runs-on: ${{ matrix.os }} steps: @@ -19,14 +29,14 @@ jobs: - name: Cache pip uses: actions/cache@v3 with: - path: ~/.cache/pip + path: ${{ matrix.path }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO uses: actions/cache@v3 with: - path: ~/.platformio + path: ${{ matrix.platformio-path }} key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Set up Python uses: actions/setup-python@v4