Skip to content

Commit

Permalink
ci: test self hosted windows runner
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyzimmer committed Oct 30, 2023
1 parent b916e54 commit 2fb7371
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
BUILD_PLATFORM: self-hosted
BUILD_PARALLELISM: 8
TEST_PARALLELISM: 8
WIN_TEST_PARALLELISM: 2
WIN_TEST_PARALLELISM: 4
COSIGN_EXPERIMENTAL: 1
RICHGO_FORCE_COLOR: 1

Expand All @@ -45,15 +45,22 @@ jobs:
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout ${{ env.LINT_TIMEOUT }}
skip-cache: ${{ vars.LINUX_TEST_PLATFORM == 'self-hosted' }}
skip-cache: ${{ startswith(vars.LINUX_TEST_PLATFORM, 'self-hosted') }}

tests:
name: Unit Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os == 'ubuntu-latest' && vars.LINUX_TEST_PLATFORM || matrix.os }}
include:
- os: ubuntu-latest
test-platform: ${{ vars.LINUX_TEST_PLATFORM == '' && 'ubuntu-latest' || vars.LINUX_TEST_PLATFORM }}
- os: macos-latest
test-platform: macos-latest
- os: windows-latest
test-platform: ${{ vars.WINDOWS_TEST_PLATFORM == '' && 'windows-latest' || vars.WINDOWS_TEST_PLATFORM }}
runs-on: ${{ matrix.test-platform }}
permissions:
contents: "read"
steps:
Expand All @@ -69,17 +76,16 @@ jobs:

- name: Setup Test Cache
uses: actions/cache@v3
if: ${{ vars.LINUX_TEST_PLATFORM != 'self-hosted' || matrix.os != 'ubuntu-latest' }}
if: ${{ !startswith(matrix.test-platform, 'self-hosted') }}
with:
key: ${{ runner.os }}-ci-tests-go-${{ env.GO_VERSION }}-${{ hashFiles(env.CACHE_DEP_PATH) }}
restore-keys: ${{ runner.os }}-ci-tests-go-${{ env.GO_VERSION }}-
key: ${{ matrix.os }}-ci-tests-go-${{ env.GO_VERSION }}-${{ hashFiles(env.CACHE_DEP_PATH) }}
restore-keys: ${{ matrix.os }}-ci-tests-go-${{ env.GO_VERSION }}-
path: |
~/go/pkg
~/go/bin
~/.cache/go-build
- name: Run Unit Tests
shell: bash
run: make ci-test

build-binaries:
Expand All @@ -105,7 +111,7 @@ jobs:

- name: Setup Build Cache
uses: actions/cache@v3
if: ${{ vars.BUILD_PLATFORM != 'self-hosted' }}
if: ${{ !startswith(vars.BUILD_PLATFORM, 'self-hosted') }}
with:
key: ${{ runner.os }}-binaries-go-${{ env.GO_VERSION }}-${{ hashFiles(env.CACHE_DEP_PATH) }}
restore-keys: ${{ runner.os }}-binaries-go-${{ env.GO_VERSION }}-
Expand Down Expand Up @@ -175,7 +181,7 @@ jobs:

- name: Setup Build Cache
uses: actions/cache@v3
if: ${{ vars.BUILD_PLATFORM == '' }}
if: ${{ !startswith(vars.BUILD_PLATFORM, 'self-hosted') }}
with:
key: ${{ runner.os }}-containers-go-${{ env.GO_VERSION }}-${{ hashFiles(env.CACHE_DEP_PATH) }}
restore-keys: ${{ runner.os }}-containers-go-${{ env.GO_VERSION }}-
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
SHELL := /bin/bash

NAME ?= node
CTL ?= wmctl
REPO ?= ghcr.io/webmeshproj
Expand Down Expand Up @@ -134,4 +132,4 @@ install-ctl: build-ctl
sudo install -m 755 dist/$(CTL) $(CTL_INSTALL_DIR)

latest-api: ## Used for development and forces a pull of the API off the main branch.
GOPRIVATE=github.com/webmeshproj $(GO) get -u github.com/webmeshproj/api@main
GOPRIVATE=github.com/webmeshproj $(GO) get -u github.com/webmeshproj/api@main

0 comments on commit 2fb7371

Please sign in to comment.