Skip to content

Trigger release actions if tag matches new -rc.X prerelease tags #710

Trigger release actions if tag matches new -rc.X prerelease tags

Trigger release actions if tag matches new -rc.X prerelease tags #710

Workflow file for this run

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"