maintenance: Update github actions #6
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: Test | |
on: | |
push: | |
branches: | |
- main | |
- next | |
pull_request: | |
jobs: | |
analyze: | |
name: dart analyze | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Dart Action | |
uses: dart-lang/setup-dart@v1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pub-cache | |
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pubspec- | |
- name: Install dependencies | |
run: dart pub get | |
- name: Analyze project source | |
run: dart analyze | |
fix: | |
name: dart fix | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Dart Action | |
uses: dart-lang/setup-dart@v1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pub-cache | |
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pubspec- | |
- name: Install dependencies | |
run: dart pub get | |
- name: Analyze project source | |
run: dart fix --dry-run | |
format: | |
name: dart format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Dart Action | |
uses: dart-lang/setup-dart@v1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pub-cache | |
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pubspec- | |
- name: Install dependencies | |
run: dart pub get | |
- name: Format | |
run: dart format --set-exit-if-changed -l 160 ./lib | |
unit-tests: | |
needs: [ format, analyze, fix ] | |
name: Unit tests | |
runs-on: ubuntu-latest | |
env: | |
TEST_TOKEN: ${{ secrets.TEST_TOKEN }} | |
TEST_TEXT_CHANNEL: ${{ secrets.TEST_TEXT_CHANNEL }} | |
TEST_GUILD: ${{ secrets.TEST_GUILD }} | |
steps: | |
- name: Setup Dart Action | |
uses: dart-lang/setup-dart@v1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pub-cache | |
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pubspec- | |
- name: Install dependencies | |
run: dart pub get | |
- name: Unit tests | |
run: dart run test test/unit/** | |
integration-tests: | |
name: Integration tests | |
needs: [ format, analyze, fix ] | |
runs-on: ubuntu-latest | |
env: | |
TEST_TOKEN: ${{ secrets.TEST_TOKEN }} | |
TEST_TEXT_CHANNEL: ${{ secrets.TEST_TEXT_CHANNEL }} | |
TEST_GUILD: ${{ secrets.TEST_GUILD }} | |
steps: | |
- name: Setup Dart Action | |
uses: dart-lang/setup-dart@v1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pub-cache | |
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pubspec- | |
- name: Install dependencies | |
run: dart pub get | |
- name: Integration tests | |
run: dart run test test/integration/** |