Skip to content

Commit

Permalink
working on ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
grantnelson-wf committed Jun 14, 2024
1 parent 47ef78a commit 064aa3a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 46 deletions.
23 changes: 11 additions & 12 deletions .github/actions/setup-gopherjs/action.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
name: Setup
description: Setup the environment for GopherJS

inputs:
os:
description: 'Operating system to run on'
required: false
default: 'ubuntu-latest'
name: Setup GopherJS
description: Sets up Go, Node.js, and GopherJS
runs:
using: composite
steps:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Node.js
# Make nodejs able to require installed modules from any working path
# and set extra flags to avoid installing node-syscall.
shell: bash
run: |
# Make nodejs able to require installed modules from any working path
echo "NODE_PATH=$(npm root)" >> $GITHUB_ENV
# Extra flags to avoid installing node-syscall.
npm install --no-optional --no-package-lock
- name: Fix TEMP variable
# see https://github.com/actions/runner-images/issues/712#issuecomment-613004302
shell: bash
if: ${{ inputs.os }} == 'windows-latest'
run: |
echo "SOURCE_MAP_SUPPORT=false" >> $env:GITHUB_ENV
# Fix TEMP variable, see https://github.com/actions/runner-images/issues/712#issuecomment-613004302
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TMPDIR=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
- name: Install GopherJS
shell: bash
run: go install -v

- name: Setup information
shell: bash
run: |
Expand Down
35 changes: 30 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
env:
GO_VERSION: 1.19.13
NODE_VERSION: 20
GOLANGCI_VERSION: v1.53.3
GOPHERJS_EXPERIMENT: generics
SOURCE_MAP_SUPPORT: true
GOPATH: ${{ github.workspace }}/go
Expand All @@ -23,21 +24,44 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-gopherjs/
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Test GopherJS
run: go test -v -short ./...
- name: Smoke tests
run: |
gopherjs build -v net/http
gopherjs test -v --short fmt log os ./tests
windows_smoke:
lint:
name: Lint Checks
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_VERSION }}
only-new-issues: true
- name: Check go.mod
run: go mod tidy && git diff --exit-code
- name: Check natives build tags
# All those packages should have // +build js.
run: diff -u <(echo -n) <(go list ./compiler/natives/src/...)

windows_smoke:
name: Windows Smoke
needs: build
runs-on: windows-latest
env:
SOURCE_MAP_SUPPORT: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-gopherjs/
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Test GopherJS
run: go test -v -short ./...
- name: Smoke tests
Expand All @@ -46,12 +70,13 @@ jobs:
gopherjs test -v --short fmt sort ./tests
darwin_smoke:
needs: build
name: Darwin Smoke
needs: build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-gopherjs/
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Test GopherJS
run: |
go test -v -short ./...
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/lint.yaml

This file was deleted.

0 comments on commit 064aa3a

Please sign in to comment.