Skip to content

Commit

Permalink
Bump CI action versions and added CI constraints, so they don't run u…
Browse files Browse the repository at this point in the history
…nnecessarily
  • Loading branch information
xBlaz3kx committed Sep 16, 2024
1 parent 7a2d521 commit 15f04fa
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/main.yml
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 }}
Expand Down

0 comments on commit 15f04fa

Please sign in to comment.