File tree Expand file tree Collapse file tree 3 files changed +60
-50
lines changed
Expand file tree Collapse file tree 3 files changed +60
-50
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11name : Test
22on :
3+ workflow_run :
4+ workflows : ["Autogenerate"]
5+ types :
6+ - completed
37 push :
48 paths-ignore :
59 - " **.md"
1317 workflow_dispatch :
1418
1519jobs :
20+ autogen :
21+ name : Generate mocks
22+ runs-on : ubuntu-latest
23+
24+ # Permissions are needed to push the changes back to the repository
25+ permissions :
26+ contents : write
27+
28+ steps :
29+ - name : Checkout code
30+ uses : actions/checkout@v4
31+ with :
32+ ref : ${{ github.head_ref }}
33+ - name : Setup Go
34+ uses : actions/setup-go@v5
35+ with :
36+ go-version : 1.17
37+ - name : Install Mockery
38+ 39+ with : # Grab a specific tag
40+ repo : vektra/mockery
41+ tag : v2.53.3
42+ - name : Generate mocks
43+ run : mockery
44+ - name : Cache generated mocks
45+ uses : actions/cache@v4
46+ with :
47+ path : |
48+ ocpp1.6_test/mocks/
49+ ocpp2.0.1_test/mocks/
50+ ocppj/mocks/
51+ ws/mocks/
52+ key : ${{ runner.os }}-mocks-${{ github.sha }}
1653 unit :
1754 runs-on : ubuntu-latest
1855 name : Unit tests
56+ needs : autogen
1957 steps :
2058 - name : Checkout code
215960+ - name : Restore generated mocks
61+ id : cache-mocks
62+ uses : actions/cache/restore@v4
63+ with :
64+ path : |
65+ ocpp1.6_test/mocks/
66+ ocpp2.0.1_test/mocks/
67+ ocppj/mocks/
68+ ws/mocks/
69+ key : ${{ runner.os }}-mocks-${{ github.sha }}
70+ - name : Check cache hit
71+ if : steps.cache-mocks.outputs.cache-hit != 'true'
72+ run : exit 1
2273 - name : Run tests
2374 run : |
2475 docker compose -f docker-compose.test.yaml up unit_test --abort-on-container-exit
54105 publish_coverage :
55106 runs-on : ubuntu-latest
56107 # Unit and integration tests must be run before publishing coverage
57- needs : [ unit, integration ]
108+ needs : [unit, integration]
58109 name : Publish coverage
59110 steps :
60111 - name : Checkout code
68119 with :
69120 path-to-profile : coverage.out
70121 env :
71- COVERALLS_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122+ COVERALLS_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1818certs /
1919
2020central_system_sim
21- charge_point_sim
21+ charge_point_sim
22+
23+ # Generatd files
24+ ocpp1.6_test /mocks /
25+ ocpp2.0.1_test /mocks /
26+ ocppj /mocks /
27+ ws /mocks /
You can’t perform that action at this time.
0 commit comments