diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..93dc04e --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml new file mode 100644 index 0000000..9646088 --- /dev/null +++ b/.github/workflows/codeql.yaml @@ -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 diff --git a/README.md b/README.md index e18652b..8789f6a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ autoindex ========= +[![Build Status](https://github.com/nielsAD/autoindex/actions/workflows/build.yml/badge.svg)](https://github.com/nielsAD/autoindex/actions) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0) Lightweight `go` web server that provides a searchable directory index. Optimized for handling large numbers of files (100k+) and remote file systems (with high latency) through a continously updated directory cache.