chore(deps): update dependency eslint to v9 #1593
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GoLang AIO CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Dependencies | |
uses: ./.github/actions/setup-deps | |
- name: Format Node | |
working-directory: ./web | |
run: yarn format | |
- name: Format Go | |
run: | | |
gofmt_output=$(gofmt -s -d .) | |
if [ -n "$gofmt_output" ]; then | |
echo "Code formatting issues found:" | |
echo "$gofmt_output" | |
exit 1 | |
fi | |
lint: | |
runs-on: ubuntu-latest | |
needs: format | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Dependencies | |
uses: ./.github/actions/setup-deps | |
- name: Lint Node | |
working-directory: ./web | |
run: yarn lint | |
- name: Analyze Go | |
run: go vet ./... | |
- name: Lint Go | |
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 | |
with: | |
version: latest | |
skip-pkg-cache: true | |
test: | |
runs-on: ubuntu-latest | |
needs: format | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Dependencies | |
uses: ./.github/actions/setup-deps | |
with: | |
setup-node: false | |
- name: Test Go | |
run: go test -v ./... | |
build-binary: | |
runs-on: ubuntu-latest | |
needs: [test, lint] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [darwin, linux, windows] | |
arch: [amd64, arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Dependencies | |
uses: ./.github/actions/setup-deps | |
- name: Build Node | |
working-directory: ./web | |
run: yarn export | |
- name: Build Go | |
env: | |
GOOS: ${{ matrix.os }} | |
GOARCH: ${{ matrix.arch }} | |
run: | | |
go build -o ./bin/golang-aio . | |
sha256sum ./bin/golang-aio > ./bin/golang-aio-checksum | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
with: | |
name: golang-aio-${{ matrix.os }}-${{ matrix.arch }} | |
path: | | |
./bin/golang-aio | |
./bin/golang-aio-checksum | |
if-no-files-found: error | |
build-docker: | |
runs-on: ubuntu-latest | |
needs: [test, lint] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Docker | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 | |
- name: Build Image | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6 | |
with: | |
context: . | |
tags: golang-aio:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
fan-in: | |
runs-on: ubuntu-latest | |
needs: [format, lint, test, build-binary, build-docker] | |
if: always() | |
steps: | |
- name: Check Jobs | |
shell: bash | |
env: | |
JOBS: ${{ toJSON(needs) }} | |
run: | | |
echo "Job status:" | |
echo $JOBS | jq -r 'to_entries[] | " - \(.key): \(.value.result)"' | |
for i in $(echo $JOBS | jq -r 'to_entries[] | .value.result'); do | |
if [ "$i" != "success" ] && [ "$i" != "skipped" ]; then | |
echo "" | |
echo "Status check not okay!" | |
exit 1 | |
fi | |
done |