maint: Consistency with the rest of the repositories #456
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- 'ubuntu/**' | |
- 'canary-*' | |
pull_request: | |
branches: | |
- main | |
- 'ubuntu/**' | |
- 'canary-*' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: asdf-vm/actions/install@v2 | |
- uses: bluefireteam/melos-action@v2 | |
- name: Install lcov | |
run: sudo apt update && sudo apt install lcov | |
- name: Install subiquity dependencies | |
working-directory: ./subiquity | |
run: make install_deps | |
- name: Prepare environment for subiquity | |
run: | | |
sudo loginctl enable-linger $USER | |
sudo systemctl start user@$UID.service | |
echo "XDG_RUNTIME_DIR=/run/user/$UID" >> $GITHUB_ENV | |
- name: Run tests | |
run: melos coverage | |
- name: Upload coverage results | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
analyze: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: dart-lang/setup-dart@v1 | |
- uses: asdf-vm/actions/install@v2 | |
- uses: bluefireteam/melos-action@v3 | |
- run: melos analyze | |
format: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: dart-lang/setup-dart@v1 | |
- uses: asdf-vm/actions/install@v2 | |
- uses: bluefireteam/melos-action@v3 | |
- run: melos format | |
generate: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: dart-lang/setup-dart@v1 | |
- uses: asdf-vm/actions/install@v2 | |
- uses: bluefireteam/melos-action@v3 | |
- run: make generate | |
- run: melos generate | |
- name: Warn about outdated generated files | |
if: github.event_name == 'pull_request' | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git diff | |
for f in $(git ls-files --modified); do | |
echo "::warning ::$f may be outdated" | |
done | |
for f in $(git ls-files --others --exclude-standard); do | |
echo "::warning ::$f may be untracked" | |
done | |
exit 1 | |
fi | |
- name: Create PR for outdated generated files | |
if: github.event_name == 'push' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: 'Regenerate files on `${{github.ref_name}}`' | |
commit-message: 'Regenerate files on `${{github.ref_name}}`' | |
generator: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- run: make check | |
working-directory: ./generator |