ci: make blacksmith usage internal only
This commit is contained in:
28
.github/workflows/daedalus-docker.yml
vendored
28
.github/workflows/daedalus-docker.yml
vendored
@@ -31,11 +31,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
skip: ${{ steps.check.outputs.skip }}
|
skip: ${{ steps.check.outputs.skip }}
|
||||||
|
internal: ${{ steps.check-internal.outputs.internal }}
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
|
- name: Check if workflow runs on an internal branch
|
||||||
|
id: check-internal
|
||||||
|
env:
|
||||||
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
|
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
if [ "$EVENT_NAME" != "pull_request" ] || [ "$HEAD_REPO" = "$REPO" ]; then
|
||||||
|
echo "internal=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "internal=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Merge Queue CI Check Skipper
|
- name: Merge Queue CI Check Skipper
|
||||||
id: merge-queue-ci-skipper
|
id: merge-queue-ci-skipper
|
||||||
uses: ./.github/merge-queue-ci-skipper
|
uses: ./.github/merge-queue-ci-skipper
|
||||||
@@ -58,18 +72,18 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
env:
|
env:
|
||||||
SCCACHE_DIR: '/mnt/sccache'
|
SCCACHE_DIR: ${{ needs.skip-if-clean.outputs.internal == 'true' && '/mnt/sccache' || '' }}
|
||||||
SCCACHE_CACHE_SIZE: '10G'
|
SCCACHE_CACHE_SIZE: ${{ needs.skip-if-clean.outputs.internal == 'true' && '10G' || '' }}
|
||||||
SCCACHE_MULTILEVEL_CHAIN: 'disk,s3'
|
SCCACHE_MULTILEVEL_CHAIN: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'disk,s3' || '' }}
|
||||||
SCCACHE_S3_KEY_PREFIX: '${{ github.repository }}/'
|
SCCACHE_S3_KEY_PREFIX: ${{ needs.skip-if-clean.outputs.internal == 'true' && format('{0}/', github.repository) || '' }}
|
||||||
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
||||||
SCCACHE_REGION: ${{ secrets.SCCACHE_REGION }}
|
SCCACHE_REGION: ${{ secrets.SCCACHE_REGION }}
|
||||||
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}
|
||||||
RUSTC_WRAPPER: 'sccache'
|
RUSTC_WRAPPER: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'sccache' || '' }}
|
||||||
needs: [skip-if-clean]
|
needs: [skip-if-clean]
|
||||||
if: ${{ needs.skip-if-clean.outputs.skip != 'true' }}
|
if: ${{ needs.skip-if-clean.outputs.skip != 'true' }}
|
||||||
steps:
|
steps:
|
||||||
@@ -92,12 +106,14 @@ jobs:
|
|||||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Mount sccache disk cache
|
- name: Mount sccache disk cache
|
||||||
|
if: needs.skip-if-clean.outputs.internal == 'true'
|
||||||
uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1.2.0
|
uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1.2.0
|
||||||
with:
|
with:
|
||||||
key: ${{ github.repository }}-daedalus-sccache
|
key: ${{ github.repository }}-daedalus-sccache
|
||||||
path: /mnt/sccache
|
path: /mnt/sccache
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
|
if: needs.skip-if-clean.outputs.internal == 'true'
|
||||||
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
|
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
|
||||||
|
|
||||||
- name: Build daedalus_client
|
- name: Build daedalus_client
|
||||||
|
|||||||
28
.github/workflows/labrinth-docker.yml
vendored
28
.github/workflows/labrinth-docker.yml
vendored
@@ -29,11 +29,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
skip: ${{ steps.check.outputs.skip }}
|
skip: ${{ steps.check.outputs.skip }}
|
||||||
|
internal: ${{ steps.check-internal.outputs.internal }}
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
|
- name: Check if workflow runs on an internal branch
|
||||||
|
id: check-internal
|
||||||
|
env:
|
||||||
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
|
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
if [ "$EVENT_NAME" != "pull_request" ] || [ "$HEAD_REPO" = "$REPO" ]; then
|
||||||
|
echo "internal=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "internal=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Merge Queue CI Check Skipper
|
- name: Merge Queue CI Check Skipper
|
||||||
id: merge-queue-ci-skipper
|
id: merge-queue-ci-skipper
|
||||||
uses: ./.github/merge-queue-ci-skipper
|
uses: ./.github/merge-queue-ci-skipper
|
||||||
@@ -56,22 +70,22 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
needs: [skip-if-clean]
|
needs: [skip-if-clean]
|
||||||
if: ${{ needs.skip-if-clean.outputs.skip != 'true' }}
|
if: ${{ needs.skip-if-clean.outputs.skip != 'true' }}
|
||||||
env:
|
env:
|
||||||
SQLX_OFFLINE: 'true'
|
SQLX_OFFLINE: 'true'
|
||||||
GIT_HASH: ${{ github.sha }}
|
GIT_HASH: ${{ github.sha }}
|
||||||
SCCACHE_DIR: '/mnt/sccache'
|
SCCACHE_DIR: ${{ needs.skip-if-clean.outputs.internal == 'true' && '/mnt/sccache' || '' }}
|
||||||
SCCACHE_CACHE_SIZE: '10G'
|
SCCACHE_CACHE_SIZE: ${{ needs.skip-if-clean.outputs.internal == 'true' && '10G' || '' }}
|
||||||
SCCACHE_MULTILEVEL_CHAIN: 'disk,s3'
|
SCCACHE_MULTILEVEL_CHAIN: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'disk,s3' || '' }}
|
||||||
SCCACHE_S3_KEY_PREFIX: '${{ github.repository }}/'
|
SCCACHE_S3_KEY_PREFIX: ${{ needs.skip-if-clean.outputs.internal == 'true' && format('{0}/', github.repository) || '' }}
|
||||||
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
||||||
SCCACHE_REGION: ${{ secrets.SCCACHE_REGION }}
|
SCCACHE_REGION: ${{ secrets.SCCACHE_REGION }}
|
||||||
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}
|
||||||
RUSTC_WRAPPER: 'sccache'
|
RUSTC_WRAPPER: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'sccache' || '' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
@@ -95,12 +109,14 @@ jobs:
|
|||||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Mount sccache disk cache
|
- name: Mount sccache disk cache
|
||||||
|
if: needs.skip-if-clean.outputs.internal == 'true'
|
||||||
uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1.2.0
|
uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1.2.0
|
||||||
with:
|
with:
|
||||||
key: ${{ github.repository }}-labrinth-sccache
|
key: ${{ github.repository }}-labrinth-sccache
|
||||||
path: /mnt/sccache
|
path: /mnt/sccache
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
|
if: needs.skip-if-clean.outputs.internal == 'true'
|
||||||
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
|
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
|
||||||
|
|
||||||
- name: Build labrinth
|
- name: Build labrinth
|
||||||
|
|||||||
1
.github/workflows/prepare-pnpm-cache.yml
vendored
1
.github/workflows/prepare-pnpm-cache.yml
vendored
@@ -13,6 +13,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
|
if: github.repository_owner == 'modrinth'
|
||||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
40
.github/workflows/turbo-ci.yml
vendored
40
.github/workflows/turbo-ci.yml
vendored
@@ -18,11 +18,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
skip: ${{ steps.check.outputs.skip }}
|
skip: ${{ steps.check.outputs.skip }}
|
||||||
|
internal: ${{ steps.check-internal.outputs.internal }}
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
|
- name: Check if workflow runs on an internal branch
|
||||||
|
id: check-internal
|
||||||
|
env:
|
||||||
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
|
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
if [ "$EVENT_NAME" != "pull_request" ] || [ "$HEAD_REPO" = "$REPO" ]; then
|
||||||
|
echo "internal=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "internal=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Merge Queue CI Check Skipper
|
- name: Merge Queue CI Check Skipper
|
||||||
id: merge-queue-ci-skipper
|
id: merge-queue-ci-skipper
|
||||||
uses: ./.github/merge-queue-ci-skipper
|
uses: ./.github/merge-queue-ci-skipper
|
||||||
@@ -31,14 +45,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Check merge_group synthetic commit
|
- name: Check merge_group synthetic commit
|
||||||
id: check
|
id: check
|
||||||
|
env:
|
||||||
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
|
SKIP_CHECK: ${{ steps.merge-queue-ci-skipper.outputs.skip-check }}
|
||||||
run: |
|
run: |
|
||||||
# PR mode: never skip
|
if [ "$EVENT_NAME" != "merge_group" ]; then
|
||||||
if [ "${{ github.event_name }}" != "merge_group" ]; then
|
|
||||||
echo "skip=false" >> $GITHUB_OUTPUT
|
echo "skip=false" >> $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${{ steps.merge-queue-ci-skipper.outputs.skip-check }}" = "true" ]; then
|
if [ "$SKIP_CHECK" = "true" ]; then
|
||||||
echo "skip=true" >> $GITHUB_OUTPUT
|
echo "skip=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "skip=false" >> $GITHUB_OUTPUT
|
echo "skip=false" >> $GITHUB_OUTPUT
|
||||||
@@ -46,7 +62,7 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
name: Lint and Test
|
name: Lint and Test
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
needs: [skip-if-clean]
|
needs: [skip-if-clean]
|
||||||
if: ${{ needs.skip-if-clean.outputs.skip != 'true' }}
|
if: ${{ needs.skip-if-clean.outputs.skip != 'true' }}
|
||||||
|
|
||||||
@@ -60,17 +76,19 @@ jobs:
|
|||||||
# since we don't want warnings to become errors
|
# since we don't want warnings to become errors
|
||||||
# while developing)
|
# while developing)
|
||||||
RUSTFLAGS: -Dwarnings
|
RUSTFLAGS: -Dwarnings
|
||||||
# sccache config
|
# sccache config (only populated for internal branches; secrets aren't
|
||||||
SCCACHE_DIR: '/mnt/sccache'
|
# available to forked PRs, and blacksmith stickydisk requires a
|
||||||
SCCACHE_CACHE_SIZE: '10G'
|
# blacksmith runner)
|
||||||
SCCACHE_MULTILEVEL_CHAIN: 'disk,s3'
|
SCCACHE_DIR: ${{ needs.skip-if-clean.outputs.internal == 'true' && '/mnt/sccache' || '' }}
|
||||||
SCCACHE_S3_KEY_PREFIX: '${{ github.repository }}/'
|
SCCACHE_CACHE_SIZE: ${{ needs.skip-if-clean.outputs.internal == 'true' && '10G' || '' }}
|
||||||
|
SCCACHE_MULTILEVEL_CHAIN: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'disk,s3' || '' }}
|
||||||
|
SCCACHE_S3_KEY_PREFIX: ${{ needs.skip-if-clean.outputs.internal == 'true' && format('{0}/', github.repository) || '' }}
|
||||||
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
||||||
SCCACHE_REGION: ${{ secrets.SCCACHE_REGION }}
|
SCCACHE_REGION: ${{ secrets.SCCACHE_REGION }}
|
||||||
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}
|
||||||
RUSTC_WRAPPER: 'sccache'
|
RUSTC_WRAPPER: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'sccache' || '' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
@@ -121,12 +139,14 @@ jobs:
|
|||||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Mount sccache disk cache
|
- name: Mount sccache disk cache
|
||||||
|
if: needs.skip-if-clean.outputs.internal == 'true'
|
||||||
uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1.2.0
|
uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1.2.0
|
||||||
with:
|
with:
|
||||||
key: ${{ github.repository }}-turbo-sccache
|
key: ${{ github.repository }}-turbo-sccache
|
||||||
path: /mnt/sccache
|
path: /mnt/sccache
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
|
if: needs.skip-if-clean.outputs.internal == 'true'
|
||||||
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
|
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
|
||||||
|
|
||||||
- name: Setup binstall
|
- name: Setup binstall
|
||||||
|
|||||||
Reference in New Issue
Block a user