Skip to content

Commit

Permalink
bug: Fix getInviteUri default scopes (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
l7ssha authored Nov 1, 2024
1 parent fb5d6bd commit 4f0d5d2
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 159 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: deploy dev docs
name: Deploy dev docs to nyxx.l7ssha.xyz

on:
push:
branches:
- dev
- next

jobs:
Expand All @@ -15,10 +14,10 @@ jobs:
uses: dart-lang/setup-dart@v1

- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }}
Expand All @@ -31,17 +30,13 @@ jobs:
- name: Generate docs
run: dart doc

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Deploy nyxx dev docs
uses: easingthemes/ssh-deploy@v2.1.5
uses: easingthemes/ssh-deploy@v5.1.0
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_SERVER_KEY }}
ARGS: "-rltDzvO"
SOURCE: "doc/api/"
TARGET: "${{ secrets.DEPLOY_REMOTE_TARGET }}/dartdocs/nyxx_extensions/${{ github.head_ref || github.ref_name }}/"
with:
REMOTE_HOST: ${{ secrets.DEPLOY_REMOTE_HOST }}
REMOTE_USER: ${{ secrets.DEPLOY_REMOTE_USER }}
TARGET: "${{ secrets.DEPLOY_REMOTE_TARGET }}/dartdocs/nyxx_extensions/${{ steps.extract_branch.outputs.branch }}/"
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_SERVER_KEY }}
29 changes: 5 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: publish
name: Publish package to pub.dev

on:
push:
branches:
- main
release:
types:
- created

jobs:
nyxx_publish:
Expand All @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v2

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pubspec-${{ hashFiles('**/pubspec.lock') }}
Expand All @@ -28,22 +28,3 @@ jobs:
force: true
suppressBuildRunner: true
credentialJson: ${{ secrets.CREDENTIAL_JSON }}

- name: 'Commit release tag'
if: steps.publish.outputs.success
uses: hole19/git-tag-action@master
env:
TAG: ${{steps.publish.outputs.package}}-${{steps.publish.outputs.localVersion}}
GITHUB_TOKEN: ${{ secrets.TAG_RELEASE_TOKEN }}

- name: 'Create Release'
if: steps.publish.outputs.success
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TAG_RELEASE_TOKEN }}
with:
tag_name: ${{steps.publish.outputs.package}}-${{steps.publish.outputs.localVersion}}
release_name: ${{steps.publish.outputs.localVersion}}
body: See CHANGELOG.md for the changes in this version.
draft: false
prerelease: false
139 changes: 139 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
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/**
84 changes: 0 additions & 84 deletions .github/workflows/unit_tests.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 4.2.1
__01.11.2024__

- bug: Fix getInviteUri default scopes

## 4.2.0
__04.10.2024__

Expand Down
46 changes: 16 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
.PHONY: help
help:
@fgrep -h "##" $(MAKEFILE_LIST) | sed -e 's/\(\:.*\#\#\)/\:\ /' | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

.PHONY: app-check ## Run basic format checks and then generate code coverage
app-check: format-check generate-coverage

.PHONY: format-check ## Check basic format
format-check: format analyze

.PHONY: generate-coverage
generate-coverage: integration-tests unit-tests coverage-format coverage-gen-html ## Run all test and generate html code coverage
format: ## Run dart format
dart format -l 160 .

.PHONY: integration-tests
integration-tests: ## Run integration tests with coverage
(timeout 20s dart run test --coverage="coverage" --timeout=none test/integration/** ; exit 0)
fix: ## Run dart fix
dart fix --apply

.PHONY: unit-tests
unit-tests: ## Run unit tests with coverage
(timeout 10s dart run test --coverage="coverage" --timeout=none test/unit/** ; exit 0)
analyze: ## Run dart analyze
dart analyze

.PHONY: coverage-format
coverage-format: ## Format dart coverage output to lcov
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/coverage.lcov --packages=.packages --report-on=lib
unit-tests: ## Run unit tests
dart run test test/unit/**

.PHONY: coverage-gen-html
coverage-gen-html: ## Generate html coverage from lcov data
genhtml coverage/coverage.lcov -o coverage/coverage_gen
integration-tests: ## Run integrations tests
ifndef TEST_TOKEN $(error TEST_TOKEN is undefined) endif \
ifndef TEST_TEXT_CHANNEL $(error TEST_TEXT_CHANNEL is undefined) endif \
ifndef TEST_GUILD $(error TEST_GUILD is undefined) endif \
dart run test test/integration/**

.PHONY: format
format: ## Run dart format
dart format --set-exit-if-changed -l 160 ./lib
fix-project: analyze fix format ## Fix whole project

.PHONY: format-apply
format-apply: ## Run dart format
dart format --fix -l 160 ./lib
test-project: unit-tests integration-tests ## Run all tests

.PHONY: analyze
analyze: ## Run dart analyze
dart analyze
check-project: fix-project test-project ## Run all checks
8 changes: 1 addition & 7 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
include: package:lints/recommended.yaml

linter:
rules:
implementation_imports: false

analyzer:
language:
strict-raw-types: true
strict-casts: false
exclude: [build/**]
Loading

0 comments on commit 4f0d5d2

Please sign in to comment.