Enable auto-generation of Lotman policies #712
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
on: [push, pull_request] | |
name: Test | |
permissions: | |
pull-requests: write | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.21.x] | |
os: [macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Do fetch depth 0 here because otherwise goreleaser might not work properly: | |
# https://goreleaser.com/ci/actions/?h=tag#workflow | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache Next.js | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '!**/node_modules/**') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install Mac OS X Dependencies | |
run: ./github_scripts/osx_install.sh | |
if: runner.os == 'macOS' | |
- name: Test OS X | |
if: runner.os == 'macOS' | |
run: | | |
make web-build | |
go test -v -coverpkg=./... -coverprofile=coverage.out -covermode=count ./... | |
- name: Test | |
if: runner.os != 'macOS' | |
run: | | |
make web-build | |
go test ./... | |
- name: Run GoReleaser for Non-Ubuntu | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: build --single-target --clean --snapshot | |
test-ubuntu: | |
uses: ./.github/workflows/test-template.yml | |
with: | |
tags: "" | |
coverprofile: "coverage.out" | |
binary_name: "pelican" | |
test-ubuntu-server: | |
uses: ./.github/workflows/test-template.yml | |
with: | |
tags: "lotman" | |
coverprofile: "coverage-server.out" | |
binary_name: "pelican-server" |