Skip to content

fix: ci

fix: ci #1605

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
release: { types: [ published ] }
jobs:
fmt:
name: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
- run: make install generate-win fmt
- run: git diff --exit-code
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v6
with: { version: 'v1.61' }
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
fail-fast: false
defaults: { run: { shell: bash } }
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
- run: make test
backwards-compatibility:
name: backwards-compatibility
runs-on: windows-latest
defaults: { run: { shell: bash } }
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
with: { path: repo }
- run: go mod vendor
working-directory: repo
- name: Move packages
run: |
mkdir -p path
mv repo/vendor path/src
mkdir -p path/src/github.com/forensicanalysis
mv repo/build/go/context path/src
mkdir -p path/src/io
mv repo/build/go/fs path/src/io
mv repo path/src/github.com/forensicanalysis/artifactcollector
find path
- name: Build with go 1.9.7
run: |
mkdir -p go1.9.7
curl -Lso go1.9.7.windows-amd64.zip https://golang.org/dl/go1.9.7.windows-amd64.zip
unzip -q go1.9.7.windows-amd64.zip -d go1.9.7
GOPATH=$GITHUB_WORKSPACE/path GOROOT=$GITHUB_WORKSPACE/go1.9.7/go go1.9.7/go/bin/go build -o artifactcollectorxp.exe github.com/forensicanalysis/artifactcollector
- name: Build with go 1.2.2
run: |
mkdir -p go1.2.2
curl -Lso go1.2.2.windows-amd64.zip https://golang.org/dl/go1.2.2.windows-amd64.zip
unzip -q go1.2.2.windows-amd64.zip -d go1.2.2
GOPATH=$GITHUB_WORKSPACE/path GOROOT=$GITHUB_WORKSPACE/go1.2.2/go go1.2.2/go/bin/go build -o artifactcollector2k.exe github.com/forensicanalysis/artifactcollector
unix:
name: artifactcollector
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
fail-fast: false
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.17' }
- uses: actions/checkout@v4
- run: go build .
- uses: actions/upload-artifact@v4
with:
name: artifactcollector ${{ matrix.os }}
path: artifactcollector
- uses: softprops/action-gh-release@v2
with:
files: artifactcollector
if: matrix.os == 'macos-latest' && github.event_name == 'release'
- uses: softprops/action-gh-release@v2
with:
files: artifactcollector
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
- run: sudo ./artifactcollector
- name: move files
run: |
mkdir output
mv *.zip output
- uses: actions/upload-artifact@v4
with:
name: output ${{ matrix.os }}
path: output
win:
name: artifactcollector (win)
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
- run: make build-win
- uses: actions/upload-artifact@v4
with:
name: artifactcollector windows-latest
path: ./build/bin/artifactcollector.exe
- uses: softprops/action-gh-release@v2
with:
files: ./build/bin/artifactcollector.exe
if: github.event_name == 'release'
- run: ./build/bin/artifactcollector.exe
- name: move files
run: |
mkdir output
mv *.zip output
- uses: actions/upload-artifact@v4
with:
name: output windows-latest
path: output
win2k:
name: artifactcollector (win2k)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
- run: make build-win2k
- uses: actions/upload-artifact@v4
with:
name: artifactcollector (Windows 2000, 32bit)
path: build/bin/artifactcollector2k.exe
- uses: softprops/action-gh-release@v2
with:
files: build/bin/artifactcollector2k.exe
if: github.event_name == 'release'
winxp:
name: artifactcollector (winxp)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with: { go-version: '1.23' }
- uses: actions/checkout@v4
- run: make build-winxp
- uses: actions/upload-artifact@v4
with:
name: artifactcollector (Windows XP, 32bit)
path: build/bin/artifactcollectorxp.exe
- uses: softprops/action-gh-release@v2
with:
files: build/bin/artifactcollectorxp.exe
if: github.event_name == 'release'