mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-21 01:50:01 +00:00
Merge 3b67d6e477f5cf2b2759f6543d510cd464650510 into 04fbf5ca50258299932c344b82a2e0b2049de142
This commit is contained in:
commit
817ac8fc07
30
.github/runner-arm/Dockerfile
vendored
Normal file
30
.github/runner-arm/Dockerfile
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
ARG RUNNER_VERSION="2.323.0"
|
||||||
|
|
||||||
|
# Prevents installdependencies.sh from prompting the user and blocking the image creation
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt update -y && apt upgrade -y && useradd -m docker
|
||||||
|
RUN apt install -y --no-install-recommends \
|
||||||
|
curl jq build-essential libssl-dev libffi-dev python3 python3-venv python3-dev python3-pip \
|
||||||
|
# dot net core dependencies
|
||||||
|
libicu74 libssl3 libkrb5-3 zlib1g libcurl4
|
||||||
|
|
||||||
|
|
||||||
|
RUN cd /home/docker && mkdir actions-runner && cd actions-runner \
|
||||||
|
&& curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz \
|
||||||
|
&& tar xzf ./actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz
|
||||||
|
|
||||||
|
RUN chown -R docker ~docker && /home/docker/actions-runner/bin/installdependencies.sh
|
||||||
|
|
||||||
|
COPY entrypoint.sh entrypoint.sh
|
||||||
|
|
||||||
|
# make the script executable
|
||||||
|
RUN chmod +x entrypoint.sh
|
||||||
|
|
||||||
|
# since the config and run script for actions are not allowed to be run by root,
|
||||||
|
# set the user to "docker" so all subsequent commands are run as the docker user
|
||||||
|
USER docker
|
||||||
|
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
18
.github/runner-arm/docker-compose.yml
vendored
Normal file
18
.github/runner-arm/docker-compose.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# docker-compose.yml
|
||||||
|
|
||||||
|
services:
|
||||||
|
github-runner:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
RUNNER_VERSION: 2.323.0
|
||||||
|
# container_name commented to allow for multiple runners
|
||||||
|
# container_name: github-runner
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- runner-work:/home/runner/actions-runner/_work
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
runner-work:
|
24
.github/runner-arm/entrypoint.sh
vendored
Normal file
24
.github/runner-arm/entrypoint.sh
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
REPOSITORY=$REPO
|
||||||
|
ACCESS_TOKEN=$GH_TOKEN
|
||||||
|
LABELS=$RUNNER_LABELS
|
||||||
|
|
||||||
|
# echo "REPO ${REPOSITORY}"
|
||||||
|
# echo "ACCESS_TOKEN ${ACCESS_TOKEN}"
|
||||||
|
|
||||||
|
REG_TOKEN=$(curl -X POST -H "Authorization: token ${ACCESS_TOKEN}" -H "Accept: application/vnd.github+json" https://api.github.com/repos/${REPOSITORY}/actions/runners/registration-token | jq .token --raw-output)
|
||||||
|
|
||||||
|
cd /home/docker/actions-runner
|
||||||
|
|
||||||
|
./config.sh --url https://github.com/${REPOSITORY} --token ${REG_TOKEN} --labels ${LABELS}
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
echo "Removing runner..."
|
||||||
|
./config.sh remove --unattended --token ${REG_TOKEN}
|
||||||
|
}
|
||||||
|
|
||||||
|
trap 'cleanup; exit 130' INT
|
||||||
|
trap 'cleanup; exit 143' TERM
|
||||||
|
|
||||||
|
./run.sh & wait $!
|
9
.github/runner-arm/example.env
vendored
Normal file
9
.github/runner-arm/example.env
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# Repository name
|
||||||
|
REPO="Magnus167/rustframe"
|
||||||
|
|
||||||
|
# GitHub runner token
|
||||||
|
GH_TOKEN="some_token_here"
|
||||||
|
|
||||||
|
# Labels for the runner
|
||||||
|
RUNNER_LABELS=self-hosted-linux,linux
|
4
.github/runner-arm/start.sh
vendored
Normal file
4
.github/runner-arm/start.sh
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
docker compose up -d --build
|
||||||
|
# docker compose up -d --build --scale github-runner=2
|
4
.github/workflows/docs-and-testcov.yml
vendored
4
.github/workflows/docs-and-testcov.yml
vendored
@ -18,7 +18,9 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docs-and-testcov:
|
docs-and-testcov:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
|
runs-on: [self-hosted, ubuntu-latest]
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
3
.github/workflows/run-unit-tests.yml
vendored
3
.github/workflows/run-unit-tests.yml
vendored
@ -14,7 +14,8 @@ jobs:
|
|||||||
run-unit-tests:
|
run-unit-tests:
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
name: run-unit-tests
|
name: run-unit-tests
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
|
runs-on: [self-hosted, ubuntu-latest]
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user