ci: add go build and nix build workflows #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install nix | |
uses: DeterminateSystems/nix-installer-action@v9 | |
- name: Setup magic-nix-cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: "go.mod" | |
- name: Tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:libations-ci | |
- name: Build Libations | |
run: | | |
nix build .#libations | |
- name: Build & Run | |
env: | |
TS_API_CLIENT_ID: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
TS_API_CLIENT_SECRET: ${{ secrets.TS_OAUTH_SECRET }} | |
run: | | |
export TS_AUTHKEY="$(go run tailscale.com/cmd/get-authkey@main -tags tag:libations-ci -ephemeral -preauth 2>/dev/null)" | |
./result/bin/libations -hostname "libations-$HOSTNAME" & &>~/libations.log | |
# Long timeout to allow a chance to issue HTTPs certs | |
set -x | |
curl -v --connect-timeout 30 "https://libations-$HOSTNAME.tailnet-d5da.ts.net" | |
curl -v "http://libations-$HOSTNAME.tailnet-d5da.ts.net" | |
- name: Dump logs | |
run: | | |
cat ~/libations.log | |