Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/** -diff linguist-generated=true
* text=auto eol=lf
dist/** -diff linguist-generated=true
4 changes: 4 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ MD004:
# Ordered list item prefix
MD029:
style: one

# Selector and input reference tables keep one entry per row.
MD013:
tables: false
6 changes: 5 additions & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
- '**.md'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-dist:
name: Check dist/
Expand All @@ -36,7 +40,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: '24'
cache: npm

- name: Install Dependencies
Expand Down
178 changes: 87 additions & 91 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,108 +1,104 @@
name: Continuous Integration

on:
pull_request:
push:
branches:
- main
- 'releases/*'

branches: [main, 'releases/*']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['20', '24']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 18
node-version: ${{ matrix.node }}
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Check Format
id: npm-format-check
run: npm run format:check

- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run ci-test

test-action:
name: GitHub Actions Test
- run: npm ci --ignore-scripts
- run: npm run format:check
- run: npm run lint
- run: npx tsc --noEmit
- run: npm run ci-test
native:
name: ${{ matrix.method }} / ${{ matrix.platform.os }} / ${{ matrix.platform.arch }} / ${{ matrix.platform.abi }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

method: [release, source]
platform:
- {os: ubuntu-24.04, arch: amd64, abi: msvc}
- {os: ubuntu-24.04-arm, arch: arm64, abi: msvc}
- {os: macos-15-intel, arch: amd64, abi: msvc}
- {os: macos-latest, arch: arm64, abi: msvc}
- {os: windows-2022, arch: amd64, abi: msvc}
- {os: windows-2022, arch: amd64, abi: mingw}
- {os: windows-11-arm, arch: arm64, abi: msvc}
- {os: windows-11-arm, arch: arm64, abi: mingw}
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Test Local Action
id: test-action
continue-on-error: ${{ matrix.os == 'windows-latest' }}
uses: ./
- uses: actions/checkout@v7
- uses: ./
id: setup
with:
llgo-version: ${{ matrix.method == 'release' && 'v1.0.4' || 'main' }}
install-method: ${{ matrix.method }}
architecture: ${{ matrix.platform.arch }}
windows-abi: ${{ matrix.platform.abi }}
- name: Check installation outputs and execute native code
shell: bash
working-directory: testdata/smoke
env:
ACTUAL_METHOD: ${{ steps.setup.outputs.install-method }}
ACTUAL_VERIFIED: ${{ steps.setup.outputs.llgo-version-verified }}
EXPECTED_VERIFIED: ${{ matrix.method == 'release' && 'true' || 'false' }}
EXPECTED_METHOD: ${{ matrix.method }}
LLGO_REVISION: ${{ steps.setup.outputs.llgo-revision }}
LLGO_ARCH: ${{ matrix.platform.arch }}
LLGO_ABI: ${{ matrix.platform.abi }}
run: |
test "$ACTUAL_METHOD" = "$EXPECTED_METHOD"
test "$ACTUAL_VERIFIED" = "$EXPECTED_VERIFIED"
test "${#LLGO_REVISION}" = 40
llgo version
llgo test -v ./...
llgo build -x -o hello.exe . > build.log 2>&1
test "$(./hello.exe | tr -d '\r')" = 42
if [[ "$RUNNER_OS" == Windows ]]; then
arch=x86_64
[[ "$LLGO_ARCH" == arm64 ]] && arch=aarch64
if [[ "$LLGO_ABI" == msvc ]]; then
grep -q "$arch-pc-windows-msvc" build.log
else
grep -Eq "$arch-(w64-windows-gnu|w64-mingw32)" build.log
fi
fi
- name: Upload build diagnostics
if: failure()
uses: actions/upload-artifact@v7
with:
llgo-version: '0.9.8'

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.llgo-version }}"

test-versions:
name: LLGo Versions Test
name: logs-${{ matrix.method }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}-${{ matrix.platform.abi }}
path: testdata/smoke/build.log
selectors:
name: Selector / ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
llgo-version: ['0.9.8', '', 'latest', 'main', 'v0.9']
include:
- llgo-version: '0.9.8'
llgo-version-verified: 'false'
- llgo-version: ''
llgo-version-verified: 'false'
- llgo-version: 'latest'
llgo-version-verified: 'false'
- llgo-version: 'main'
llgo-version-verified: 'false'
- llgo-version: 'v0.9'
llgo-version-verified: 'false'

runs-on: ubuntu-24.04

version: ['v1.0', 'v1.0.*', '^1.0.3', '7db1409073f28bf13a35ae0a3ea663eba010fd73', '7db1409']
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Test LLGo Version
id: test-llgo-version
uses: ./
- uses: actions/checkout@v7
- uses: ./
with:
llgo-version: ${{ matrix.llgo-version }}

# - name: Test version verified
# env:
# VERIFIED: ${{ matrix.llgo-version-verified }}
# LLGO_VERSION: ${{ matrix.llgo-version }}
# run: |
# echo "llgo-version: $LLGO_VERSION"
# echo "llgo-version-verified: $VERIFIED"
# if [[ "$VERIFIED" != "$VERIFIED" ]]; then
# echo "llgo-version-verified does not match expected value"
# echo "expected: $VERIFIED, got: $VERIFIED"
# exit 1
# fi
llgo-version: ${{ matrix.version }}
- run: llgo test -v ./...
working-directory: testdata/smoke
11 changes: 9 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches-ignore:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint Code Base
Expand All @@ -16,7 +20,6 @@ jobs:
permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout
Expand All @@ -27,7 +30,7 @@ jobs:
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: '24'
cache: npm

- name: Install Dependencies
Expand All @@ -42,4 +45,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_JSCPD: false
# LLGo smoke fixtures are compiled together by the native CI matrix.
# Super-linter v5 invokes Go type checking separately on each file.
VALIDATE_GO: false
MULTI_STATUS: false
FILTER_REGEX_EXCLUDE: dist/*
Loading
Loading