-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from DragonFlyBSD/feat-add-build-workflows
Add actions workflows to test the build
- Loading branch information
Showing
3 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: pull-request | ||
|
||
on: | ||
pull_request: | ||
types: [opened,reopened,synchronize] | ||
branches: [master] | ||
|
||
jobs: | ||
pr_run_dfly: | ||
runs-on: macos-12 | ||
name: Pull requests DragonFly BSD | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and test in DragonFly BSD | ||
id: build-test-dfly | ||
uses: vmactions/dragonflybsd-vm@v0 | ||
with: | ||
mem: 4096 | ||
usesh: true | ||
prepare: | | ||
pkg install -y go curl | ||
run: | | ||
make | ||
make test | ||
pr_run_linux: | ||
runs-on: [ubuntu-latest] | ||
name: Pull requests Linux | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
- name: Build mirrorselect | ||
run: make | ||
- name: Tests | ||
run: make test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build_dfly: | ||
runs-on: macos-12 | ||
name: Release build and tests on dfly | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and test in DragonFly BSD | ||
id: build-test-dfly | ||
uses: vmactions/dragonflybsd-vm@v0 | ||
with: | ||
mem: 4096 | ||
usesh: true | ||
prepare: | | ||
pkg install -y go curl | ||
run: | | ||
make | ||
make test | ||
release: | ||
runs-on: [ubuntu-latest] | ||
needs: build_dfly | ||
name: Release | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/github-tag-action@v6.1 | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
all: | ||
go build -o mirrorselect main.go | ||
GOOS=dragonfly GOARCH=amd64 go build -o mirrorselect main.go | ||
GOOS=freebsd GOARCH=amd64 go build -o mirrorselect main.go | ||
|
||
test: dbip | ||
go test -v ./common ./geoip ./monitor ./workerpool | ||
|
||
clean: | ||
rm -f mirrorselect | ||
|
||
dbip: testdata/dbip-city-lite-2021-02.mmdb | ||
testdata/dbip-city-lite-2021-02.mmdb: | ||
curl https://download.db-ip.com/free/dbip-city-lite-2021-02.mmdb.gz | \ | ||
curl https://download.db-ip.com/free/dbip-city-lite-2023-03.mmdb.gz | \ | ||
gunzip > $@ |