evcc-io/.github/workflows/default.yml
Michael Geers 9ef3f5f307
Fix nightly/release + integration workflow (#8450)
* Revert "Add e2e tests with playwright (#8123)"

This reverts commit 0df815729b.

* Revert "Revert "Add e2e tests with playwright (#8123)""

This reverts commit 2299306954.

* fix nightly/release

* fix nightly/release

* fix nightly/release

---------

Co-authored-by: andig <cpuidle@gmx.de>
2023-06-13 23:12:22 +02:00

184 lines
3.6 KiB
YAML

name: Default
on:
push:
branches:
- master
pull_request:
workflow_call:
jobs:
clean:
name: Clean
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - uses: actions/setup-go@v4
- uses: erezrokah/setup-go@feat/add_cache_prefix
with:
go-version: ^1.20
cache-key-prefix: clean-cache-
id: go
- name: Install tools
run: make install
- name: Assets
run: make assets
- name: Docs
run: make docs
- name: Toml
run: make toml
- name: Porcelain
run: make porcelain
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: erezrokah/setup-go@feat/add_cache_prefix
with:
go-version: ^1.20
cache-key-prefix: build-cache-
id: go
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- name: Install UI
run: make install-ui
- name: Build UI
run: make ui
- name: Build
run: make build
- name: Cache dist
uses: actions/cache/save@v3
id: cache-dist
with:
path: dist
key: ${{ runner.os }}-${{ github.sha }}-dist
- name: Upload
uses: actions/upload-artifact@v3
with:
name: evcc-binary
path: ./evcc
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - uses: actions/setup-go@v4
- uses: erezrokah/setup-go@feat/add_cache_prefix
with:
go-version: ^1.20
cache-key-prefix: test-cache-
id: go
- name: Test
run: mkdir dist && touch dist/empty && make test
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ^1.20
cache: false # avoid cache thrashing
id: go
- run: mkdir dist && touch dist/empty
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 5m
ui:
name: UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- name: Install
run: make install-ui
- name: Lint
run: make lint-ui
- name: Test
run: make test-ui
- name: Porcelain
run: |
test -z "$(git status --porcelain)" || (git status; git diff; false)
integration:
name: Integration
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_call' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- name: Install npm
run: npm ci
- run: npx playwright install --with-deps chromium
- name: Wait for Build
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-name: Build
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- uses: actions/download-artifact@v3
with:
name: evcc-binary
- name: Make executable
run: chmod +x evcc
- name: Run tests
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30