2022-08-07 10:57:45 +12:00
|
|
|
name: Tests
|
2022-07-30 08:43:49 +12:00
|
|
|
on:
|
|
|
|
pull_request:
|
2023-09-25 16:07:11 +13:00
|
|
|
branches: [ develop, 'feature/**' ]
|
2022-07-30 08:43:49 +12:00
|
|
|
push:
|
2022-08-10 09:48:06 +12:00
|
|
|
branches: [ develop, 'feature/**' ]
|
2022-07-30 08:43:49 +12:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-09-22 15:32:51 +12:00
|
|
|
go-version: [1.21.x]
|
2022-07-30 08:43:49 +12:00
|
|
|
os: [ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2023-04-01 21:12:36 +13:00
|
|
|
- uses: actions/setup-go@v4
|
2022-07-30 08:43:49 +12:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- uses: actions/checkout@v3
|
2022-07-30 23:52:57 +12:00
|
|
|
- uses: actions/cache@v3
|
2022-07-30 23:53:55 +12:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
2023-09-25 19:25:45 +13:00
|
|
|
- run: go test ./internal/storage ./server ./internal/tools -v
|
|
|
|
- run: go test ./internal/storage -bench=.
|
2022-07-30 09:04:25 +12:00
|
|
|
|
|
|
|
# build the assets
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-10-15 09:35:06 +13:00
|
|
|
node-version: 18
|
2022-07-30 09:04:25 +12:00
|
|
|
cache: 'npm'
|
|
|
|
- run: npm install
|
|
|
|
- run: npm run package
|