feat(auth): ensure session refresh after updating server credentials #210
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: Dart Tests | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
# optional parameters follow | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache | |
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies | |
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Prepare env file | |
run: cp .env.sample .env | |
- name: Run tests | |
run: | | |
dart run full_coverage | |
flutter test --coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
prepare-release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.head_ref, 'release-v') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Extract version from branch | |
id: extract_version | |
run: | | |
branch_name="${{ github.head_ref }}" | |
version="${branch_name#release-v}" | |
echo "version=v$version" >> $GITHUB_ENV | |
- name: Generate changelog | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: cliff.toml | |
args: --tag ${{ env.version }} | |
env: | |
OUTPUT: CHANGELOG.md | |
GITHUB_REPO: ${{ github.repository }} | |
- name: Commit Changelog | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout ${{ github.head_ref }} | |
git add CHANGELOG.md | |
git commit -m "Update CHANGELOG for version ${{ env.version }}" | |
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ github.head_ref }} | |
- name: Update version in pubspec.yaml | |
run: | | |
version_without_v=${{ env.version }} | |
version_without_v=${version_without_v#v} | |
sed -i "s/^version: .*/version: $version_without_v/" pubspec.yaml | |
git add pubspec.yaml | |
git commit -m "Update pubspec.yaml version to ${{ env.version }}" | |
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ github.head_ref || github.ref_name }} | |