mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
chore: clean up github actions workflows
This commit is contained in:
parent
089cc9750f
commit
ba81191312
7 changed files with 79 additions and 101 deletions
1
.github/workflows/dashboard.yml
vendored
1
.github/workflows/dashboard.yml
vendored
|
|
@ -8,6 +8,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: 'dashboard docker build'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: '.net docker build'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
@ -1,20 +1,35 @@
|
||||||
name: Format check on pull request
|
name: .net checks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
|
- .github/workflows/dotnet.yml
|
||||||
- 'Myriad/**'
|
- 'Myriad/**'
|
||||||
- 'PluralKit.API/**'
|
- 'PluralKit.API/**'
|
||||||
- 'PluralKit.Bot/**'
|
- 'PluralKit.Bot/**'
|
||||||
- 'PluralKit.Core/**'
|
- 'PluralKit.Core/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
|
- .github/workflows/dotnet.yml
|
||||||
- 'Myriad/**'
|
- 'Myriad/**'
|
||||||
- 'PluralKit.API/**'
|
- 'PluralKit.API/**'
|
||||||
- 'PluralKit.Bot/**'
|
- 'PluralKit.Bot/**'
|
||||||
- 'PluralKit.Core/**'
|
- 'PluralKit.Core/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
test:
|
||||||
|
name: 'run .net tests'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Setup .NET Core
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: 8.0.x
|
||||||
|
- name: Run automated tests
|
||||||
|
run: dotnet test --configuration Release
|
||||||
dotnet-format:
|
dotnet-format:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
41
.github/workflows/dotnetcore.yml
vendored
41
.github/workflows/dotnetcore.yml
vendored
|
|
@ -1,41 +0,0 @@
|
||||||
name: .NET Core
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'Myriad/**'
|
|
||||||
- 'PluralKit.API/**'
|
|
||||||
- 'PluralKit.Bot/**'
|
|
||||||
- 'PluralKit.Core/**'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'Myriad/**'
|
|
||||||
- 'PluralKit.API/**'
|
|
||||||
- 'PluralKit.Bot/**'
|
|
||||||
- 'PluralKit.Core/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Setup .NET Core
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
|
||||||
dotnet-version: 8.0.x
|
|
||||||
- name: Build with dotnet
|
|
||||||
run: dotnet build --configuration Release
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Setup .NET Core
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
|
||||||
dotnet-version: 8.0.x
|
|
||||||
- name: Run automated tests
|
|
||||||
run: dotnet test --configuration Release
|
|
||||||
47
.github/workflows/rust-docker.yml
vendored
Normal file
47
.github/workflows/rust-docker.yml
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
name: Build and push Rust service Docker images
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'crates/**'
|
||||||
|
- '.github/workflows/rust.yml'
|
||||||
|
- 'ci/Dockerfile.rust'
|
||||||
|
- 'ci/rust-docker-target.sh'
|
||||||
|
- 'Cargo.toml'
|
||||||
|
- 'Cargo.lock'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: 'rust docker build'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
if: github.repository == 'PluralKit/PluralKit'
|
||||||
|
steps:
|
||||||
|
- uses: docker/login-action@v1
|
||||||
|
if: ${{ !env.ACT }}
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.CR_PAT }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
# main docker build
|
||||||
|
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
|
||||||
|
- uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
# https://github.com/docker/build-push-action/issues/378
|
||||||
|
context: .
|
||||||
|
file: ci/Dockerfile.rust
|
||||||
|
push: false
|
||||||
|
cache-from: type=registry,ref=ghcr.io/pluralkit/docker-cache:rust
|
||||||
|
cache-to: type=registry,ref=ghcr.io/pluralkit/docker-cache:rust,mode=max
|
||||||
|
outputs: .docker-bin
|
||||||
|
|
||||||
|
# add more binaries here
|
||||||
|
- run: |
|
||||||
|
tag=${{ github.sha }} \
|
||||||
|
branch=${{ env.BRANCH_NAME }} \
|
||||||
|
push=$([ "${{ github.repository }}" == "PluralKit/PluralKit" ] && echo true || echo false) \
|
||||||
|
ci/rust-docker-target.sh
|
||||||
57
.github/workflows/rust.yml
vendored
57
.github/workflows/rust.yml
vendored
|
|
@ -1,51 +1,22 @@
|
||||||
# todo: use https://github.com/jpribyl/action-docker-layer-caching
|
name: rust checks
|
||||||
# todo: make this generic for all Rust images in this repo
|
|
||||||
# todo: don't use docker/build-push-action
|
|
||||||
# todo: run builds on pull request
|
|
||||||
|
|
||||||
name: Build and push Rust service Docker images
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'crates/**'
|
- .github/workflows/rust.yml
|
||||||
- '.github/workflows/rust.yml'
|
- 'crates/**'
|
||||||
- 'ci/Dockerfile.rust'
|
pull_request:
|
||||||
- 'ci/rust-docker-target.sh'
|
paths:
|
||||||
- 'Cargo.toml'
|
- .github/workflows/rust.yml
|
||||||
- 'Cargo.lock'
|
- 'crates/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
rustfmt:
|
||||||
|
name: cargo fmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
if: github.repository == 'PluralKit/PluralKit'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: docker/login-action@v1
|
- uses: actions/checkout@v4
|
||||||
if: ${{ !env.ACT }}
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
components: rustfmt
|
||||||
username: ${{ github.actor }}
|
- name: Rustfmt Check
|
||||||
password: ${{ secrets.CR_PAT }}
|
uses: actions-rust-lang/rustfmt@v1
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
# main docker build
|
|
||||||
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
|
|
||||||
- uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
# https://github.com/docker/build-push-action/issues/378
|
|
||||||
context: .
|
|
||||||
file: ci/Dockerfile.rust
|
|
||||||
push: false
|
|
||||||
cache-from: type=registry,ref=ghcr.io/pluralkit/docker-cache:rust
|
|
||||||
cache-to: type=registry,ref=ghcr.io/pluralkit/docker-cache:rust,mode=max
|
|
||||||
outputs: .docker-bin
|
|
||||||
|
|
||||||
# add more binaries here
|
|
||||||
- run: |
|
|
||||||
tag=${{ github.sha }} \
|
|
||||||
branch=${{ env.BRANCH_NAME }} \
|
|
||||||
push=$([ "${{ github.repository }}" == "PluralKit/PluralKit" ] && echo true || echo false) \
|
|
||||||
ci/rust-docker-target.sh
|
|
||||||
|
|
|
||||||
16
.github/workflows/rustfmt.yml
vendored
16
.github/workflows/rustfmt.yml
vendored
|
|
@ -1,16 +0,0 @@
|
||||||
name: "Check Rust formatting"
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rustfmt:
|
|
||||||
name: cargo fmt
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
||||||
with:
|
|
||||||
components: rustfmt
|
|
||||||
- name: Rustfmt Check
|
|
||||||
uses: actions-rust-lang/rustfmt@v1
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue