Use GitHub Actions

This commit is contained in:
NielsAD
2022-01-23 20:53:01 +01:00
parent 0f9168d044
commit 785dce97bd
3 changed files with 79 additions and 0 deletions

52
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Build
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.os }}, go${{ matrix.go }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: [1.17]
defaults:
run:
shell: bash
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Vet
run: go vet
- name: Build
run: go build
- name: Prepare artifacts
run: |
echo -e "Author: Niels A.D.
Project: autoindex (https://github.com/nielsAD/autoindex)
Platform: `go env GOOS`/`go env GOARCH` (`go env GOVERSION`)
Release: $GITHUB_REF_NAME ($GITHUB_SHA)
Date: `date --utc`" > VERSION.txt
mv autoindex.exe autoindex-$GITHUB_REF_NAME.exe || true
mv autoindex autoindex-$GITHUB_REF_NAME || true
mv LICENSE LICENSE.txt
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: autoindex_${{ github.ref_name }}_${{ runner.os }}
path: |
autoindex-*
LICENSE.txt
VERSION.txt

26
.github/workflows/codeql.yaml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: CodeQL
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '0 0 * * 0'
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1