|
| 1 | +name: tests |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | +permissions: |
| 5 | + contents: read |
| 6 | +jobs: |
| 7 | + tests: |
| 8 | + name: tests |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 13 | + |
| 14 | + steps: |
| 15 | + - uses: actions/setup-go@v3 |
| 16 | + with: |
| 17 | + go-version: "1.18.10" |
| 18 | + - uses: actions/setup-node@v3 |
| 19 | + with: |
| 20 | + node-version: "12" |
| 21 | + - name: Set up environment |
| 22 | + if: matrix.os != 'windows-latest' |
| 23 | + run: | |
| 24 | + echo "SOURCE_MAP_SUPPORT=true" >> $GITHUB_ENV |
| 25 | + # Make nodejs able to require installed modules from any working path. |
| 26 | + echo "NODE_PATH=$(npm root)" >> $GITHUB_ENV |
| 27 | + echo ::notice::$(go version) |
| 28 | + echo ::notice::$(node -v) |
| 29 | + echo ::notice::$(npm -v) |
| 30 | + - name: Set up environment |
| 31 | + if: matrix.os == 'windows-latest' |
| 32 | + run: | |
| 33 | + # Fix TEMP variable, see https://github.com/actions/runner-images/issues/712#issuecomment-613004302 |
| 34 | + echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV |
| 35 | + echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV |
| 36 | + echo "TMPDIR=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV |
| 37 | + echo "NODE_PATH=$(npm root)" >> $env:GITHUB_ENV |
| 38 | + echo "SOURCE_MAP_SUPPORT=false" >> $env:GITHUB_ENV |
| 39 | + echo "::notice::$(npm root)" |
| 40 | + echo "::notice::$(node -v)" |
| 41 | + echo "::notice::$(npm -v)" |
| 42 | + - uses: actions/checkout@v3 |
| 43 | + - name: Install required Node.js packages |
| 44 | + if: matrix.os == 'ubuntu-latest' |
| 45 | + run: | |
| 46 | + npm ci |
| 47 | + - name: Install required Node.js packages |
| 48 | + if: matrix.os != 'ubuntu-latest' |
| 49 | + run: | |
| 50 | + # Extra flags to avoid installing node-syscall. |
| 51 | + npm install --no-optional --no-package-lock |
| 52 | + - name: Build and Install GopherJS |
| 53 | + run: | |
| 54 | + go install -v |
| 55 | + echo ::notice::$(gopherjs version) |
| 56 | +
|
| 57 | + - name: Smoke tests |
| 58 | + if: matrix.os == 'ubuntu-latest' |
| 59 | + run: | |
| 60 | + gopherjs build -v net/http |
| 61 | + gopherjs test -v fmt log |
| 62 | + - name: Smoke tests |
| 63 | + if: matrix.os == 'macos-latest' |
| 64 | + run: | |
| 65 | + gopherjs build -v net/http |
| 66 | + gopherjs test -v --short fmt log os ./tests |
| 67 | + - name: Smoke tests |
| 68 | + if: matrix.os == 'windows-latest' |
| 69 | + run: | |
| 70 | + gopherjs build -v net/http |
| 71 | + gopherjs test -v --short fmt sort ./tests |
0 commit comments