-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump CI action versions and added CI constraints, so they don't run u…
…nnecessarily
- Loading branch information
Showing
1 changed file
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,51 @@ | ||
name: Default CI | ||
on: [push, pull_request, workflow_dispatch] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "*.md" | ||
- "*.sh" | ||
|
||
pull_request: | ||
paths-ignore: | ||
- "*.md" | ||
- "*.sh" | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
# This workflow contains a job called "test", which is run on every push | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v5.0.2 | ||
with: | ||
go-version: ^1.18 | ||
cache: true | ||
|
||
- name: Setup toxiproxy | ||
run: | | ||
wget -O toxiproxy-2.1.4.deb https://github.com/Shopify/toxiproxy/releases/download/v2.1.4/toxiproxy_2.1.4_amd64.deb | ||
sudo dpkg -i toxiproxy-2.1.4.deb | ||
sudo cp ws/toxiproxy.service /lib/systemd/system/ | ||
sudo systemctl start toxiproxy | ||
- name: Run tests | ||
run: | | ||
go test ./ws ./ocppj -v -covermode=count -coverprofile=coverage.out | ||
go test -v -covermode=count -coverprofile=ocpp16.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp1.6/... github.com/lorenzodonini/ocpp-go/ocpp1.6_test | ||
go test -v -covermode=count -coverprofile=ocpp201.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp2.0.1/... github.com/lorenzodonini/ocpp-go/ocpp2.0.1_test | ||
sed '1d;$d' ocpp16.out >> coverage.out | ||
sed '1d;$d' ocpp201.out >> coverage.out | ||
- name: Install goveralls | ||
run: go install github.com/mattn/goveralls@latest | ||
|
||
- name: Publish coverage | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|