Skip to content

bump tsgo to 0970dc40fa83 #330

bump tsgo to 0970dc40fa83

bump tsgo to 0970dc40fa83 #330

Workflow file for this run

name: CI
permissions:
contents: read
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
- name: Init submodules
run: |
git submodule update --init --depth 1 extern/typescript-go
git submodule update --init --depth 1 extern/tstl
- name: Apply tsgo patches
run: ./scripts/apply-tsgo-patches.sh
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26"
- name: Cache Go build
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: go-build-${{ runner.os }}-${{ hashFiles('go.sum') }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
cache: npm
- name: Install tools
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install gotest.tools/gotestsum@latest
- name: Install npm dependencies
run: |
npm ci
cd extern/tstl && npm ci
- name: Cache Lua runtimes
id: lua-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: .lua-runtimes
key: lua-runtimes-${{ runner.os }}-${{ hashFiles('scripts/lua-versions.txt', 'scripts/build-lua.sh') }}
- name: Install Lua build dependencies
if: steps.lua-cache.outputs.cache-hit != 'true'
run: sudo apt-get install -y libreadline-dev
- name: Build Lua runtimes
run: ./scripts/build-lua.sh
- name: Build tslua
run: go build -o tslua ./cmd/tslua/
- name: Tests
run: |
export PATH="$PWD/.lua-runtimes/bin:$PATH"
FORCE_COLOR=1 gotestsum --format short -- \
-coverpkg=./internal/transpiler/,./internal/lua/,./internal/lualib/,./internal/lualibinfo/,./internal/sourcemap/ \
-coverprofile=coverage.out \
-covermode=atomic \
./internal/... \
-skip TestCodegen_
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out
golangci-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
- name: Init submodules
run: |
git submodule update --init --depth 1 extern/typescript-go
- name: Apply tsgo patches
run: ./scripts/apply-tsgo-patches.sh
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26"
- name: Cache Go build
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: go-build-${{ runner.os }}-${{ hashFiles('go.sum') }}
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: v2.11.4
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
- name: Init submodules
run: |
git submodule update --init --depth 1 extern/typescript-go
git submodule update --init --depth 1 extern/tstl
- name: Apply tsgo patches
run: ./scripts/apply-tsgo-patches.sh
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26"
- name: Cache Go build
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: go-build-${{ runner.os }}-${{ hashFiles('go.sum') }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
cache: npm
- name: Install npm dependencies
run: npm ci
- name: Install website dependencies
working-directory: website
run: npm ci
- name: Build TSTL
run: |
./scripts/apply-tstl-patches.sh
cd extern/tstl && npm ci && npm run build
- name: Check lualib freshness
run: |
./scripts/update-lualib.sh
git diff --exit-code internal/lualib/ || {
echo "::error::Committed lualib files are stale. Run 'just update-lualib' and commit the result."
exit 1
}
- name: Check formatting
run: npx oxfmt --check scripts/ website/
- name: typecheck
run: npm run typecheck
- name: astro check
working-directory: website
run: npx astro check
- name: oxlint
run: npx oxlint scripts/ website/
- name: Website tests
working-directory: website
run: npm test