Skip to content

Improve internal docs #27

Improve internal docs

Improve internal docs #27

Workflow file for this run

name: bolt
on:
- pull_request
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
# Enable fail-fast behavior
shell: bash
env:
store: /home/runner/nix
jobs:
check:
runs-on: [self-hosted, linux, x64]
steps:
# MARK: Git
- name: Checkout
uses: actions/checkout@v3.5.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
# MARK: Nix
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixpkgs-23.05
extra_nix_config: "store = ${{ env.store }}\n"
install_url: https://releases.nixos.org/nix/nix-2.15.0/install
- name: Nix Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-nix-${{ hashfiles('./shell.nix', './nix/**/*.nix') }}
path: ${{ env.store }}
restore-keys: |
${{ runner.os }}-nix-${{ hashfiles('./shell.nix', './nix/**/*.nix') }}
${{ runner.os }}-nix-
- name: Build Shell
run: nix-shell --pure --run "echo 'Built shell'"
# MARK: Rust
- name: Rust Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-rust
path: |
~/.cargo/registry
~/.cargo/git
target
# MARK: Bolt
- name: Bolt Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-cargo
path: |
.bolt-meta.json
gen/
- name: Write Namespace Config
run: |
# Write Namespace config
cat <<'EOF' > namespaces/ci.toml
pools = []
[deploy.local]
public_ip = "1.2.3.4"
[dns.domain]
main = "ci.rivet.gg"
cdn = "ci.rivet.game"
job = "ci.rivet.run"
[dns.cloudflare]
account_id = "2a94c6a0ced8d35ea63cddc86c2681e7"
[dns.cloudflare.zones]
root = "d95c48588b898e7f3b96a2dedd2a19bd"
game = "a37fb47b921131c69db59551f7c281f6"
job = "f5d5af8267f87db85b6776f47e471fee"
[email.sendgrid]
[s3.minio]
EOF
# Empty secrets
touch secrets/ci.toml
- name: Setup
run: nix-shell --pure --run "SKIP_GIT_LFS=1 NPM_GLOBAL=1 ./scripts/setup.sh"
- name: Bolt Generate
run: nix-shell --pure --run "BOLT_NAMESPACE=ci BOLT_IGNORE_TERRAFORM=1 bolt generate all"
- name: Bolt Check
run: nix-shell --pure --run "BOLT_NAMESPACE=ci BOLT_IGNORE_TERRAFORM=1 bolt check --validate-format"
# TODO: Make this run only whe migrations change
# TODO: Broken for some reason
# - name: Bolt Database Migrate Check
# run: nix-shell --pure --run "BOLT_NAMESPACE=ci BOLT_IGNORE_TERRAFORM=1 bolt database migrate check"