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:
|
||||
build:
|
||||
name: 'dashboard docker build'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: '.net docker build'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
|
|
@ -1,20 +1,35 @@
|
|||
name: Format check on pull request
|
||||
name: .net checks
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/dotnet.yml
|
||||
- 'Myriad/**'
|
||||
- 'PluralKit.API/**'
|
||||
- 'PluralKit.Bot/**'
|
||||
- 'PluralKit.Core/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/dotnet.yml
|
||||
- 'Myriad/**'
|
||||
- 'PluralKit.API/**'
|
||||
- 'PluralKit.Bot/**'
|
||||
- 'PluralKit.Core/**'
|
||||
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
55
.github/workflows/rust.yml
vendored
55
.github/workflows/rust.yml
vendored
|
|
@ -1,51 +1,22 @@
|
|||
# todo: use https://github.com/jpribyl/action-docker-layer-caching
|
||||
# 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
|
||||
name: rust checks
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/rust.yml
|
||||
- 'crates/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/rust.yml
|
||||
- 'crates/**'
|
||||
- '.github/workflows/rust.yml'
|
||||
- 'ci/Dockerfile.rust'
|
||||
- 'ci/rust-docker-target.sh'
|
||||
- 'Cargo.toml'
|
||||
- 'Cargo.lock'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
rustfmt:
|
||||
name: cargo fmt
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
if: github.repository == 'PluralKit/PluralKit'
|
||||
steps:
|
||||
- uses: docker/login-action@v1
|
||||
if: ${{ !env.ACT }}
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
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
|
||||
components: rustfmt
|
||||
- name: Rustfmt Check
|
||||
uses: actions-rust-lang/rustfmt@v1
|
||||
|
|
|
|||
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