Skip to content

Feature(actions): add testing #1

Feature(actions): add testing

Feature(actions): add testing #1

Workflow file for this run

name: Test
concurrency:
group: test-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
pull_request:
jobs:
build-test:
name: Build Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'
- name: Cache go module
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run test
run: |
go test ./...
docker-test:
name: Docker Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
tags: tun2socks:test
- name: Run tun2socks
run: |
docker run --rm \
-v $(pwd):/resume \
--workdir /resume \
ghcr.io/ghcr.io/typst/typst:latest \
sh -euc "typst --version && typst compile --font-path ./fonts resume.typ"