diff --git a/.github/actions/create-pull/action.yaml b/.github/actions/create-pull/action.yaml index ac9da6e2..f2a3587b 100644 --- a/.github/actions/create-pull/action.yaml +++ b/.github/actions/create-pull/action.yaml @@ -18,7 +18,7 @@ inputs: outputs: pull_number: description: The pull request number - value: '${{ steps.create-pull.outputs.pull_number }}' + value: "${{ steps.create-pull.outputs.pull_number }}" runs: using: composite diff --git a/.github/actions/merge-pull/action.yaml b/.github/actions/merge-pull/action.yaml index ffae1d9e..5beed859 100644 --- a/.github/actions/merge-pull/action.yaml +++ b/.github/actions/merge-pull/action.yaml @@ -7,14 +7,14 @@ inputs: description: The pull request number required: true merge_method: - description: 'The merge method to use. Valid values are: - github_merge, github_squash, github_rebase, rebase' + description: "The merge method to use. Valid values are: + github_merge, github_squash, github_rebase, rebase" required: false - default: 'rebase' + default: "rebase" delete_head: description: Delete the head branch after merge required: false - default: 'false' + default: "false" github_token: description: The GitHub token to use required: true diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index a5dca868..ee1c3bde 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,26 +1,25 @@ version: 2 updates: - - package-ecosystem: 'github-actions' - directory: '/.github/' - target-branch: 'staging' + - package-ecosystem: "github-actions" + directory: "/.github" + target-branch: "staging" schedule: - interval: 'weekly' - day: 'saturday' + interval: "daily" - - package-ecosystem: 'nuget' - directory: '/services/api' - target-branch: 'staging' + - package-ecosystem: "nuget" + directory: "/services/api" + target-branch: "staging" schedule: - interval: 'weekly' - day: 'saturday' + interval: "weekly" + day: "saturday" - - package-ecosystem: 'docker' - directory: '/services/web' - target-branch: 'staging' + - package-ecosystem: "docker" + directory: "/services/web" + target-branch: "staging" schedule: - interval: 'daily' - - package-ecosystem: 'docker' - directory: '/services/api' - target-branch: 'staging' + interval: "daily" + - package-ecosystem: "docker" + directory: "/services/api" + target-branch: "staging" schedule: - interval: 'daily' + interval: "daily" diff --git a/.github/workflows/deploy-docker.yaml b/.github/workflows/deploy-docker.yaml index 8df8b9de..c7c34caf 100644 --- a/.github/workflows/deploy-docker.yaml +++ b/.github/workflows/deploy-docker.yaml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checking out the repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 - name: Setting up Quick Emulator (QEMU) uses: docker/setup-qemu-action@v2.1.0 @@ -65,7 +65,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checking out the repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 - name: Setting up Quick Emulator (QEMU) uses: docker/setup-qemu-action@v2.1.0 diff --git a/.github/workflows/format-api.yaml b/.github/workflows/format-api.yaml index b9bc6ccc..d33e698e 100644 --- a/.github/workflows/format-api.yaml +++ b/.github/workflows/format-api.yaml @@ -1,15 +1,15 @@ -name: Format api - -on: - workflow_call: - -jobs: - main: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: services/api - steps: - - name: Checking out the repository - uses: actions/checkout@v3.3.0 +name: Format api + +on: + workflow_call: + +jobs: + main: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: services/api + steps: + - name: Checking out the repository + uses: actions/checkout@v3.5.2 diff --git a/.github/workflows/format-web.yaml b/.github/workflows/format-web.yaml index 64dd366f..23fa444f 100644 --- a/.github/workflows/format-web.yaml +++ b/.github/workflows/format-web.yaml @@ -1,69 +1,69 @@ -name: Format web - -on: - workflow_call: - -jobs: - main: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: services/web - steps: - - name: Checking out the repository - uses: actions/checkout@v3.3.0 - - - name: Using pnpm version 7.x.x - uses: pnpm/action-setup@v2.2.4 - with: - version: 7.x.x - - - name: Using node version 18 - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: services/web/pnpm-lock.yaml - - - name: Installing dependencies - run: pnpm install --frozen-lockfile - - - name: Formatting code - run: pnpm run format - - - name: Preparing merge - id: prepare - run: | - if ! git diff --quiet - then - TEMP_BRANCH=$(uuidgen) - echo "TEMP_BRANCH=$TEMP_BRANCH" >> $GITHUB_OUTPUT - git config user.name github-actions - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git checkout -b $TEMP_BRANCH - git add --update - git commit --message "github-actions: fix code style" - git push origin $TEMP_BRANCH - else - echo "Nothing to commit!" - fi - - - name: Creating pull request - if: steps.prepare.outputs.TEMP_BRANCH != null - id: create-pull - uses: ./.github/actions/create-pull - with: - github_token: ${{ secrets.github_token }} - base: staging - head: ${{ steps.prepare.outputs.TEMP_BRANCH }} - title: 'github-actions: fix code style' - - - name: Merging pull request - if: steps.create-pull.outputs.pull_number != null - uses: ./.github/actions/merge-pull - with: - github_token: ${{ secrets.github_token }} - pull_number: ${{ steps.create-pull.outputs.pull_number }} - merge_method: 'github_squash' - delete_head: true +name: Format web + +on: + workflow_call: + +jobs: + main: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: services/web + steps: + - name: Checking out the repository + uses: actions/checkout@v3.5.2 + + - name: Using pnpm version 7.x.x + uses: pnpm/action-setup@v2.2.4 + with: + version: 7.x.x + + - name: Using node version 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + cache-dependency-path: services/web/pnpm-lock.yaml + + - name: Installing dependencies + run: pnpm install --frozen-lockfile + + - name: Formatting code + run: pnpm run format + + - name: Preparing merge + id: prepare + run: | + if ! git diff --quiet + then + TEMP_BRANCH=$(uuidgen) + echo "TEMP_BRANCH=$TEMP_BRANCH" >> $GITHUB_OUTPUT + git config user.name github-actions + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git checkout -b $TEMP_BRANCH + git add --update + git commit --message "github-actions: fix code style" + git push origin $TEMP_BRANCH + else + echo "Nothing to commit!" + fi + + - name: Creating pull request + if: steps.prepare.outputs.TEMP_BRANCH != null + id: create-pull + uses: ./.github/actions/create-pull + with: + github_token: ${{ secrets.github_token }} + base: staging + head: ${{ steps.prepare.outputs.TEMP_BRANCH }} + title: "github-actions: fix code style" + + - name: Merging pull request + if: steps.create-pull.outputs.pull_number != null + uses: ./.github/actions/merge-pull + with: + github_token: ${{ secrets.github_token }} + pull_number: ${{ steps.create-pull.outputs.pull_number }} + merge_method: "github_squash" + delete_head: true diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d2ac65f5..d2a8335a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checking out the repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 - name: Merging pull request uses: ./.github/actions/merge-pull diff --git a/.github/workflows/pull-request-main.yaml b/.github/workflows/pull-request-main.yaml index f42d714c..8e269962 100644 --- a/.github/workflows/pull-request-main.yaml +++ b/.github/workflows/pull-request-main.yaml @@ -1,21 +1,21 @@ -name: Pull request main - -on: - workflow_dispatch: - -jobs: - create-pull: - runs-on: ubuntu-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v3 - - - name: Creating pull request - uses: ./.github/actions/create-pull - id: create-pull - with: - # Make sure to trigger pull request workflows - github_token: ${{ secrets.WORKFLOW_TOKEN }} - base: main - head: staging - title: 'github-actions: merge staging into main' +name: Pull request main + +on: + workflow_dispatch: + +jobs: + create-pull: + runs-on: ubuntu-latest + steps: + - name: Checking out the repository + uses: actions/checkout@v3.5.2 + + - name: Creating pull request + uses: ./.github/actions/create-pull + id: create-pull + with: + # Make sure to trigger pull request workflows + github_token: ${{ secrets.WORKFLOW_TOKEN }} + base: main + head: staging + title: "github-actions: merge staging into main" diff --git a/.github/workflows/test-api.yaml b/.github/workflows/test-api.yaml index 5a5448dc..d9f429f2 100644 --- a/.github/workflows/test-api.yaml +++ b/.github/workflows/test-api.yaml @@ -1,30 +1,30 @@ -name: Test api - -on: - workflow_call: - -jobs: - main: - defaults: - run: - shell: bash - working-directory: services/api - strategy: - matrix: - configuration: [Debug, Release] - runs-on: ubuntu-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v3.3.0 - - - name: Setting up dotnet - uses: actions/setup-dotnet@v3.0.3 - - - name: Restoring solution - run: dotnet restore - - - name: Building solution - run: dotnet build --no-restore --configuration ${{ matrix.configuration }} - - - name: Running tests - run: dotnet test --no-restore --no-build --configuration ${{ matrix.configuration }} +name: Test api + +on: + workflow_call: + +jobs: + main: + defaults: + run: + shell: bash + working-directory: services/api + strategy: + matrix: + configuration: [Debug, Release] + runs-on: ubuntu-latest + steps: + - name: Checking out the repository + uses: actions/checkout@v3.5.2 + + - name: Setting up dotnet + uses: actions/setup-dotnet@v3.1.0 + + - name: Restoring solution + run: dotnet restore + + - name: Building solution + run: dotnet build --no-restore --configuration ${{ matrix.configuration }} + + - name: Running tests + run: dotnet test --no-restore --no-build --configuration ${{ matrix.configuration }} diff --git a/.github/workflows/test-web.yaml b/.github/workflows/test-web.yaml index 4be1ff1c..7dd98c09 100644 --- a/.github/workflows/test-web.yaml +++ b/.github/workflows/test-web.yaml @@ -1,42 +1,42 @@ -name: Test web - -on: - workflow_call: - -jobs: - main: - defaults: - run: - shell: bash - working-directory: services/web - runs-on: ubuntu-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v3.3.0 - - - name: Using pnpm version 7.x.x - uses: pnpm/action-setup@v2.2.4 - with: - version: 7.x.x - - - name: Using node version 18 - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: services/web/pnpm-lock.yaml - - - name: Installing dependencies - run: pnpm install --frozen-lockfile - - - name: Running typecheck - run: pnpm run typecheck - - - name: Building the project - run: pnpm run build - - - name: Checking for unfixable code style issues - run: pnpm run lint --fix-dry-run - - - name: Checking for no console statements - run: pnpm run lint:no-console +name: Test web + +on: + workflow_call: + +jobs: + main: + defaults: + run: + shell: bash + working-directory: services/web + runs-on: ubuntu-latest + steps: + - name: Checking out the repository + uses: actions/checkout@v3.5.2 + + - name: Using pnpm version 7.x.x + uses: pnpm/action-setup@v2.2.4 + with: + version: 7.x.x + + - name: Using node version 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + cache-dependency-path: services/web/pnpm-lock.yaml + + - name: Installing dependencies + run: pnpm install --frozen-lockfile + + - name: Running typecheck + run: pnpm run typecheck + + - name: Building the project + run: pnpm run build + + - name: Checking for unfixable code style issues + run: pnpm run lint --fix-dry-run + + - name: Checking for no console statements + run: pnpm run lint:no-console