Fix dart analyze warnings
#47
Workflow file for this run
This file contains hidden or 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: Test/Build | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+*" | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: dart-lang/setup-dart@v1 | |
| - run: dart pub get | |
| # - run: dart format --output=none --set-exit-if-changed . | |
| - run: dart analyze --fatal-warnings | |
| - run: dart test --exclude-tags=skip-ci | |
| build: | |
| needs: test | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| # os: [ubuntu-latest, macos-latest, windows-latest] | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Dart SDK | |
| uses: dart-lang/setup-dart@v1 | |
| - name: Get dependencies | |
| run: dart pub get | |
| - name: Compile on ${{ matrix.os }} | |
| if: runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/v') | |
| run: mkdir -p build && dart compile exe bin/xpm.dart -o build/xpm-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m) | |
| - name: Gzip compiled file on ${{ matrix.os }} | |
| if: runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/v') | |
| run: gzip --best --keep build/xpm-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m) | |
| - name: Compile on Windows | |
| if: runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/v') | |
| run: mkdir -p build && dart compile exe bin/xpm.dart -o build/xpm-windows-${{ runner.arch }} | |
| - name: Gzip compiled file on Windows | |
| if: runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/v') | |
| run: gzip --best --keep build/xpm-windows-${{ runner.arch }} | |
| - name: Release build for ${{ matrix.os }} | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| prerelease: ${{ !endsWith(github.ref, '.0') }} | |
| fail_on_unmatched_files: false | |
| append_body: true | |
| files: build/xpm-* | |
| publish: | |
| needs: test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write # This is required for authentication using OIDC | |
| uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 | |
| # with: | |
| # working-directory: path/to/package/within/repository |