|
1 | | -name: PlatformIO CI |
| 1 | +name: WLED CI |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + pull_request: |
4 | 8 |
|
5 | 9 | jobs: |
6 | | - |
7 | | - get_default_envs: |
8 | | - name: Gather Environments |
9 | | - runs-on: ubuntu-latest |
10 | | - steps: |
11 | | - - uses: actions/checkout@v3 |
12 | | - - name: Cache pip |
13 | | - uses: actions/cache@v3 |
14 | | - with: |
15 | | - path: ~/.cache/pip |
16 | | - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
17 | | - restore-keys: | |
18 | | - ${{ runner.os }}-pip- |
19 | | - - uses: actions/setup-python@v4 |
20 | | - with: |
21 | | - python-version: '3.9' |
22 | | - - name: Install PlatformIO |
23 | | - run: pip install -r requirements.txt |
24 | | - - name: Get default environments |
25 | | - id: envs |
26 | | - run: | |
27 | | - echo "environments=$(pio project config --json-output | jq -cr '.[0][1][0][1]')" >> $GITHUB_OUTPUT |
28 | | - outputs: |
29 | | - environments: ${{ steps.envs.outputs.environments }} |
30 | | - |
31 | | - |
32 | | - build: |
33 | | - name: Build Enviornments |
34 | | - runs-on: ubuntu-latest |
35 | | - needs: get_default_envs |
36 | | - strategy: |
37 | | - fail-fast: false |
38 | | - matrix: |
39 | | - environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} |
40 | | - steps: |
41 | | - - uses: actions/checkout@v3 |
42 | | - - name: Cache pip |
43 | | - uses: actions/cache@v3 |
44 | | - with: |
45 | | - path: ~/.cache/pip |
46 | | - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
47 | | - restore-keys: | |
48 | | - ${{ runner.os }}-pip- |
49 | | - - name: Cache PlatformIO |
50 | | - uses: actions/cache@v3 |
51 | | - with: |
52 | | - path: ~/.platformio |
53 | | - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} |
54 | | - - name: Set up Python |
55 | | - uses: actions/setup-python@v4 |
56 | | - with: |
57 | | - python-version: '3.9' |
58 | | - - name: Install PlatformIO |
59 | | - run: pip install -r requirements.txt |
60 | | - - name: Build firmware |
61 | | - env: |
62 | | - WLED_RELEASE: True |
63 | | - run: pio run -e ${{ matrix.environment }} |
64 | | - - uses: actions/upload-artifact@v2 |
65 | | - with: |
66 | | - name: firmware-${{ matrix.environment }} |
67 | | - path: | |
68 | | - build_output/firmware/*.bin |
69 | | - build_output/firmware/*.gz |
70 | | - - uses: actions/upload-artifact@v2 |
71 | | - if: startsWith(github.ref, 'refs/tags/') |
72 | | - with: |
73 | | - name: firmware-release |
74 | | - path: build_output/release/*.bin |
75 | | - release: |
76 | | - name: Create Release |
77 | | - runs-on: ubuntu-latest |
78 | | - needs: [get_default_envs, build] |
79 | | - if: startsWith(github.ref, 'refs/tags/') |
80 | | - steps: |
81 | | - - uses: actions/download-artifact@v2 |
82 | | - with: |
83 | | - name: firmware-release |
84 | | - - name: Create draft release |
85 | | - uses: softprops/action-gh-release@v1 |
86 | | - with: |
87 | | - draft: True |
88 | | - files: | |
89 | | - *.bin |
90 | | - env: |
91 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 10 | + wled_build: |
| 11 | + uses: ./.github/workflows/build.yml |
0 commit comments