|
1 | 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@v4 |
12 | | - - uses: actions/setup-python@v5 |
13 | | - with: |
14 | | - python-version: '3.12' |
15 | | - cache: 'pip' |
16 | | - - name: Install PlatformIO |
17 | | - run: pip install -r requirements.txt |
18 | | - - name: Get default environments |
19 | | - id: envs |
20 | | - run: | |
21 | | - echo "environments=$(pio project config --json-output | jq -cr '.[0][1][0][1]')" >> $GITHUB_OUTPUT |
22 | | - outputs: |
23 | | - environments: ${{ steps.envs.outputs.environments }} |
24 | | - |
25 | | - |
26 | | - build: |
27 | | - name: Build Enviornments |
28 | | - runs-on: ubuntu-latest |
29 | | - needs: get_default_envs |
30 | | - strategy: |
31 | | - fail-fast: false |
32 | | - matrix: |
33 | | - environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} |
34 | | - steps: |
35 | | - - uses: actions/checkout@v4 |
36 | | - - name: Set up Node.js |
37 | | - uses: actions/setup-node@v4 |
38 | | - with: |
39 | | - cache: 'npm' |
40 | | - - run: npm ci |
41 | | - - name: Cache PlatformIO |
42 | | - uses: actions/cache@v4 |
43 | | - with: |
44 | | - path: | |
45 | | - ~/.platformio/.cache |
46 | | - ~/.buildcache |
47 | | - build_output |
48 | | - key: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}-${{ hashFiles('wled00/**', 'usermods/**') }} |
49 | | - restore-keys: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}- |
50 | | - - name: Set up Python |
51 | | - uses: actions/setup-python@v5 |
52 | | - with: |
53 | | - python-version: '3.12' |
54 | | - cache: 'pip' |
55 | | - - name: Install PlatformIO |
56 | | - run: pip install -r requirements.txt |
57 | | - - name: Build firmware |
58 | | - run: pio run -e ${{ matrix.environment }} |
59 | | - - uses: actions/upload-artifact@v4 |
60 | | - with: |
61 | | - name: firmware-${{ matrix.environment }} |
62 | | - path: | |
63 | | - build_output/release/*.bin |
64 | | - build_output/release/*_ESP02*.bin.gz |
65 | | - release: |
66 | | - name: Create Release |
67 | | - runs-on: ubuntu-latest |
68 | | - needs: build |
69 | | - if: startsWith(github.ref, 'refs/tags/') |
70 | | - steps: |
71 | | - - uses: actions/download-artifact@v4 |
72 | | - with: |
73 | | - merge-multiple: true |
74 | | - - name: Create draft release |
75 | | - uses: softprops/action-gh-release@v1 |
76 | | - with: |
77 | | - draft: True |
78 | | - files: | |
79 | | - *.bin |
80 | | - *.bin.gz |
81 | | -
|
82 | | -
|
83 | | - testCdata: |
84 | | - name: Test cdata.js |
85 | | - runs-on: ubuntu-latest |
86 | | - steps: |
87 | | - - uses: actions/checkout@v4 |
88 | | - - name: Use Node.js |
89 | | - uses: actions/setup-node@v4 |
90 | | - with: |
91 | | - node-version: '20.x' |
92 | | - cache: 'npm' |
93 | | - - run: npm ci |
94 | | - - run: npm test |
| 10 | + wled_build: |
| 11 | + uses: ./.github/workflows/build.yml |
0 commit comments