Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
update github actions versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JensDll committed May 26, 2023
1 parent bf96798 commit 2b77632
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .github/actions/create-pull/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/merge-pull/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 17 additions & 18 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/format-api.yaml
Original file line number Diff line number Diff line change
@@ -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
138 changes: 69 additions & 69 deletions .github/workflows/format-web.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/pull-request-main.yaml
Original file line number Diff line number Diff line change
@@ -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"
60 changes: 30 additions & 30 deletions .github/workflows/test-api.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading

0 comments on commit 2b77632

Please sign in to comment.