Allow value export of unsafe code by passing variable names to the na… #115
Workflow file for this run
This file contains hidden or 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: TypeShell Linux | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - '*' | |
| release: | |
| types: | |
| - created | |
| permissions: | |
| contents: write | |
| jobs: | |
| test-batch: | |
| name: Test Batch | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22.x' | |
| - name: Install dependencies | |
| run: | | |
| go get . | |
| - name: Test | |
| shell: cmd | |
| run: | | |
| go build tsh.go | |
| go test ./tests -v -cover -coverprofile=coverage.out -coverpkg ./lexer,./parser,./transpiler || exit -1 | |
| go tool cover -func=coverage.out | |
| test-bash: | |
| needs: test-batch | |
| name: Test Bash | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22.x' | |
| - name: Install dependencies | |
| run: | | |
| go get . | |
| - name: Test Bash | |
| shell: bash | |
| run: | | |
| go build tsh.go | |
| go test ./tests -v -cover -coverprofile=coverage.out -coverpkg ./lexer,./parser,./transpiler || exit -1 | |
| go tool cover -func=coverage.out | |
| build: | |
| needs: test-bash | |
| name: Build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: ['linux', 'windows'] | |
| arch: ['386', 'amd64', 'arm64'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.os }}" == "windows" ]; then | |
| EXT=".exe" | |
| else | |
| EXT= | |
| fi | |
| NAME="tsh_${{ matrix.os }}_${{ matrix.arch }}" | |
| PACKAGE="${NAME}.zip" | |
| echo "PACKAGE<<EOF" >> $GITHUB_ENV | |
| echo "${PACKAGE}" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| EXECUTABLE="${NAME}${EXT}" | |
| echo "Building for ${{ matrix.os }} ${{ matrix.arch }}" | |
| GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o "${EXECUTABLE}" tsh.go | |
| zip -r "${PACKAGE}" std/ "${EXECUTABLE}" "README.md" | |
| - name: Release | |
| if: ${{ github.event_name == 'release' }} | |
| run: | | |
| echo "Uploading ${{ env.PACKAGE }} release file" | |
| gh release upload ${{ github.event.release.tag_name }} ${{ env.PACKAGE }} | |
| env: | |
| GH_TOKEN: ${{ github.TOKEN }} |