diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 5b6c099d8..cde0ccd77 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -44,15 +44,31 @@ jobs: 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: 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: mkdir dist && touch dist/empty && make build + run: make build + + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: evcc-binary + path: ./evcc test: name: Test @@ -92,7 +108,7 @@ jobs: version: latest args: --timeout 5m - build-ui: + ui: name: UI runs-on: ubuntu-latest @@ -104,7 +120,7 @@ jobs: node-version: "18" cache: "npm" - - name: Install tools + - name: Install run: make install-ui - name: Lint @@ -113,12 +129,48 @@ jobs: - name: Test run: make test-ui - - name: Build - run: make ui + - name: Porcelain + run: | + test -z "$(git status --porcelain)" || (git status; git diff; false) - - name: Cache dist - uses: actions/cache/save@v3 - id: cache-dist + integration: + name: Integration + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 with: - path: dist - key: ${{ runner.os }}-${{ github.sha }}-dist + 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 diff --git a/.gitignore b/.gitignore index 9da0cd4c1..5d5fc691e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ __debug_bin !util/templates/**/*.yaml !package*.json !evcc.dist.yaml +!tests/**/*.evcc.yaml evcc evcc.exe evcc_* @@ -32,3 +33,6 @@ fly.toml vendor/* QEMU_EFI.fd asset-stats.html +/test-results/ +/playwright-report/ +/playwright/.cache/ diff --git a/assets/js/components/Energyflow/Visualization.vue b/assets/js/components/Energyflow/Visualization.vue index 57745dd67..53aa89d14 100644 --- a/assets/js/components/Energyflow/Visualization.vue +++ b/assets/js/components/Energyflow/Visualization.vue @@ -1,5 +1,9 @@