Skip to content

Update module github.com/sethvargo/go-githubactions to v1 #66

Update module github.com/sethvargo/go-githubactions to v1

Update module github.com/sethvargo/go-githubactions to v1 #66

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Set cache paths
id: go-cache-paths
run: |
echo "::set-output name=build::$(go env GOCACHE)"
echo "::set-output name=mod::$(go env GOMODCACHE)"
- name: Go cache
uses: actions/cache@v3
with:
path: |
${{ steps.go-cache-paths.outputs.build }}
${{ steps.go-cache-paths.outputs.mod }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test -race -v ./...
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: action
with:
environments: |-
- staging
- production
- uses: actions/github-script@v6
env:
workspaces: '${{ steps.action.outputs.workspaces }}'
workspacetags: '${{ steps.action.outputs.workspace_tags }}'
workspacevariables: '${{ steps.action.outputs.workspace_variables }}'
tags: '${{ steps.action.outputs.tags }}'
name: '${{ steps.action.outputs.name }}'
with:
script: |
require('./test/e2e.js')({
workspaces: JSON.parse(process.env.workspaces),
workspaceTags: JSON.parse(process.env.workspacetags),
workspaceVariables: JSON.parse(process.env.workspacevariables),
tags: JSON.parse(process.env.tags),
name: process.env.name,
})