feat: Migrate CI to gitea
This commit is contained in:
committed by
Hunter Halloran
parent
d205211c7d
commit
a23ec91c9c
@@ -66,7 +66,7 @@ sudo nixos-rebuild build --flake .
|
||||
|
||||
## Continuous Integration
|
||||
|
||||
The repository uses GitHub Actions for automated testing and validation. CI jobs run on the self-hosted `nix-builder` machine via SSH.
|
||||
The repository uses Gitea Actions for automated testing and validation. CI jobs run on the self-hosted `nix-builder` machine.
|
||||
|
||||
### CI Workflow
|
||||
|
||||
@@ -94,7 +94,7 @@ Check the CI status badge at the top of the README or view detailed logs:
|
||||
|
||||
```bash
|
||||
# View workflow status
|
||||
https://github.com/UGA-Innovation-Factory/nixos-systems/actions
|
||||
https://git.factory.uga.edu/UGA-Innovation-Factory/athenix/actions
|
||||
```
|
||||
|
||||
### Running CI Checks Locally
|
||||
@@ -118,49 +118,49 @@ nix build .#lxc-nix-builder
|
||||
|
||||
### Self-Hosted Runner
|
||||
|
||||
CI jobs run on the `nix-builder` host as a self-hosted GitHub Actions runner. This provides:
|
||||
CI jobs run on the `nix-builder` host as a self-hosted Gitea Actions runner. This provides:
|
||||
|
||||
- Native Nix environment without installation overhead
|
||||
- Access to local Nix store for faster builds
|
||||
- Consistent build environment matching deployment targets
|
||||
- Direct access to build caching infrastructure
|
||||
|
||||
#### Setting Up the GitHub Actions Runner
|
||||
#### Setting Up the Gitea Actions Runner
|
||||
|
||||
The nix-builder host is configured with a GitHub Actions self-hosted runner in `inventory.nix`. To complete the setup:
|
||||
The nix-builder host is configured with a Gitea Actions self-hosted runner in `inventory.nix`. To complete the setup:
|
||||
|
||||
1. **Generate a GitHub Personal Access Token (PAT)**:
|
||||
- Go to https://github.com/settings/tokens
|
||||
- Create a new token with `repo` scope
|
||||
- Copy the token value
|
||||
1. **Generate a Gitea Runner Token**:
|
||||
- Go to https://git.factory.uga.edu/UGA-Innovation-Factory/athenix/settings/actions/runners
|
||||
- Click "Create new Runner"
|
||||
- Copy the registration token
|
||||
|
||||
2. **Create the token file on nix-builder**:
|
||||
```bash
|
||||
ssh engr-ugaif@nix-builder
|
||||
echo "YOUR_TOKEN_HERE" | sudo tee /var/lib/github-runner-token > /dev/null
|
||||
sudo chmod 600 /var/lib/github-runner-token
|
||||
echo "YOUR_TOKEN_HERE" | sudo tee /var/lib/gitea-runner-token > /dev/null
|
||||
sudo chmod 600 /var/lib/gitea-runner-token
|
||||
```
|
||||
|
||||
3. **Rebuild the system** to start the runner:
|
||||
```bash
|
||||
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems#nix-builder
|
||||
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#nix-builder
|
||||
```
|
||||
|
||||
4. **Verify the runner is registered**:
|
||||
- Check https://github.com/UGA-Innovation-Factory/nixos-systems/settings/actions/runners
|
||||
- Check https://git.factory.uga.edu/UGA-Innovation-Factory/athenix/settings/actions/runners
|
||||
- The runner should appear with the `nix-builder` label
|
||||
|
||||
The runner service is configured in the nix-builder device configuration and will automatically:
|
||||
- Register with the repository on first start
|
||||
- Use the `nix-builder` label for workflow targeting
|
||||
- Run as the `engr-ugaif` user
|
||||
- Store work in `/var/lib/github-runner`
|
||||
- Store work in `/var/lib/gitea-runner`
|
||||
|
||||
### Troubleshooting CI Failures
|
||||
|
||||
If CI fails:
|
||||
|
||||
1. **Check the error logs** in the GitHub Actions tab
|
||||
1. **Check the error logs** in the Gitea Actions tab
|
||||
2. **Run the same command locally** to reproduce the issue
|
||||
3. **Use `--show-trace`** for detailed error information
|
||||
4. **Verify formatting** with `nix fmt` if format check fails
|
||||
@@ -195,13 +195,13 @@ sudo nixos-rebuild build --flake .
|
||||
|
||||
```bash
|
||||
# Rebuild from GitHub main branch
|
||||
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems
|
||||
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git
|
||||
|
||||
# Use --impure for external user configurations with fetchGit
|
||||
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems --impure
|
||||
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git --impure
|
||||
|
||||
# Rebuild specific host from GitHub
|
||||
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems#nix-laptop1
|
||||
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#nix-laptop1
|
||||
```
|
||||
|
||||
### Boot into Previous Generation
|
||||
|
||||
Reference in New Issue
Block a user