generated from asdf-vm/asdf-plugin-template
55 lines (49 loc) · 1.34 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '12 4 * * *'
jobs:
go-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.value }}
steps:
- id: versions
run: |
versions=$(curl -s 'https://go.dev/dl/?mode=json' | jq -c 'map(.version[2:])')
echo "::set-output name=value::${versions}"
plugin_test:
needs: go-versions
name: asdf plugin test
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
base-go-version:
- ~1.12.0
- ~1.17.0
- ~1.18.0
version: ${{fromJson(needs.go-versions.outputs.versions)}}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.base-go-version }}
- name: Set outputs
id: vars
run: |
echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
echo ::set-output name=version::$(go run lib/tools.go resolve-version ${{ matrix.version }})
- name: asdf_plugin_test
uses: asdf-vm/actions/plugin-test@v1
with:
command: go version
gitref: ${{ steps.vars.outputs.short_ref }}
version: ${{ steps.vars.outputs.version }}