Skip to content

build: update GitHub actions versions #29

build: update GitHub actions versions

build: update GitHub actions versions #29

Workflow file for this run

---
# Github Actions build for swift
# -*- compile-command: "yamllint -f parsable build.yml" -*-
name: build
# Trigger the workflow on push or pull request
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
workflow_dispatch:
inputs:
manual:
required: true
default: true
jobs:
build:
if: ${{ github.repository == 'ncw/swift' || github.event.inputs.manual }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
job_name: ['go1.23', 'go1.22', 'go1.21']
include:
- job_name: go1.23
os: ubuntu-latest
go: '1.23.x'
gotests: true
integrationtest: true
check: true
- job_name: go1.22
os: ubuntu-latest
go: '1.22.x'
gotests: true
integrationtest: true
check: false
- job_name: go1.21
os: ubuntu-latest
go: '1.21.x'
gotests: true
integrationtest: true
check: false
name: ${{ matrix.job_name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Print Go version and environment
shell: bash
run: |
printf "Using go at: $(which go)\n"
printf "Go version: $(go version)\n"
printf "\n\nGo environment:\n\n"
go env
printf "\n\nSystem environment:\n\n"
env
- name: Go module cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
shell: bash
run: |
go build ./...
- name: Unit tests
shell: bash
run: |
go test -v
if: matrix.gotests
- name: Integration tests
shell: bash
run: |
./integration_test.sh
if: matrix.integrationtest
- name: Code quality test
uses: golangci/golangci-lint-action@v6
with:
# Version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
if: matrix.check