2022-11-06 07:42:20 +01:00
|
|
|
name: Go Tests
|
2022-04-09 20:56:25 +02:00
|
|
|
|
|
|
|
on:
|
2022-05-28 03:52:09 +02:00
|
|
|
workflow_dispatch:
|
2022-09-17 20:54:26 +02:00
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
2022-04-09 20:56:25 +02:00
|
|
|
push:
|
2022-04-09 20:58:49 +02:00
|
|
|
branches: [ master ]
|
2022-04-09 20:56:25 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-04-09 21:19:01 +02:00
|
|
|
test:
|
2022-04-17 19:50:37 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-10 00:12:15 +01:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2022-11-05 06:52:02 +01:00
|
|
|
fail-fast: false
|
2022-04-09 20:56:25 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Go
|
2022-09-21 08:20:28 +02:00
|
|
|
uses: actions/setup-go@v3
|
2022-04-09 20:56:25 +02:00
|
|
|
with:
|
2022-09-04 06:25:00 +02:00
|
|
|
go-version: 1.18
|
2023-09-03 02:58:36 +02:00
|
|
|
- name: Test setup
|
2022-04-17 20:56:00 +02:00
|
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') }}
|
2022-04-18 05:08:54 +02:00
|
|
|
run: |
|
2023-09-03 02:58:36 +02:00
|
|
|
|
2023-09-03 02:33:02 +02:00
|
|
|
# Install our dependencies
|
2022-04-18 08:06:01 +02:00
|
|
|
sudo apt-get update || true
|
2022-12-14 02:15:11 +01:00
|
|
|
sudo apt-get install -y zsh tmux fish || true
|
2022-10-23 19:10:23 +02:00
|
|
|
brew install fish tmux bash || true
|
2023-09-03 02:33:02 +02:00
|
|
|
|
|
|
|
# Work around a weird bug where zsh on ubuntu actions gives that directory 0777 which makes zsh refuse to start
|
|
|
|
sudo chmod 0755 -R /usr/share/zsh/ || true
|
|
|
|
|
|
|
|
# Set a consistent hostname so we can run tests that depend on it
|
|
|
|
sudo hostname ghaction-runner-hostname || true
|
2022-11-01 22:33:27 +01:00
|
|
|
sudo scutil --set HostName ghaction-runner-hostname || true
|
2023-09-03 02:33:02 +02:00
|
|
|
|
|
|
|
# Set up a tmpfs for ~/.hishtory/ to help tests run faster
|
|
|
|
mkdir ~/.hishtory/
|
2023-09-03 02:35:22 +02:00
|
|
|
sudo mount -F tmpfs -o size=500M swap ~/.hishtory/ || true
|
|
|
|
sudo diskutil apfs create $(sudo hdiutil attach -nomount ram://1024000) RAMDisk || true
|
|
|
|
sudo mount -o noatime -t apfs /Volumes/RAMDisk ~/.hishtory/ || true
|
2023-09-03 02:58:36 +02:00
|
|
|
- name: Go test
|
|
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') }}
|
|
|
|
run: |
|
|
|
|
|
|
|
|
# Force the time zone so that test output is consistent
|
|
|
|
export TZ='America/Los_Angeles'
|
2023-09-03 02:33:02 +02:00
|
|
|
|
|
|
|
# Run the tests
|
2022-04-18 05:08:54 +02:00
|
|
|
make test
|
2023-08-28 03:23:21 +02:00
|
|
|
# - name: Setup tmate session
|
|
|
|
# if: ${{ failure() }}
|
|
|
|
# uses: mxschmitt/action-tmate@v3
|
|
|
|
# with:
|
|
|
|
# limit-access-to-actor: true
|