Skip to content

Commit f26d16b

Browse files
committed
ci: don't test for FreeBSD on PRs
1 parent 8f9fe8f commit f26d16b

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

.github/workflows/ci.yaml

+34-2
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,39 @@ jobs:
11391139

11401140
# This is ci/actions-templates/freebsd-builds-template.yaml
11411141
# Do not edit this file in .github/workflows
1142-
build-freebsd: # job-name
1142+
build-freebsd-master: # job-name skip-stable
11431143
runs-on: ubuntu-latest
1144+
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-stable
1145+
steps:
1146+
- uses: actions/checkout@v4
1147+
with:
1148+
# v2 defaults to a shallow checkout, but we need at least to the previous tag
1149+
fetch-depth: 0
1150+
- name: Acquire tags for the repo
1151+
run: |
1152+
git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
1153+
- name: Run a full build
1154+
uses: vmactions/freebsd-vm@v1
1155+
with:
1156+
release: 13.2
1157+
usesh: true
1158+
copyback: false
1159+
prepare: |
1160+
pkg install -y git gmake bash sudo
1161+
run: |
1162+
echo "========="
1163+
echo "create non-root user and log into it"
1164+
pw group add -n tester
1165+
pw user add -n tester -g tester -s `which bash`
1166+
pw user mod tester -d `pwd`
1167+
chown -R tester .
1168+
sudo -u tester bash ci/freebsd/script.bash
1169+
1170+
# This is ci/actions-templates/freebsd-builds-template.yaml
1171+
# Do not edit this file in .github/workflows
1172+
build-freebsd-stable: # job-name skip-master
1173+
runs-on: ubuntu-latest
1174+
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-master
11441175
steps:
11451176
- uses: actions/checkout@v4
11461177
with:
@@ -1324,7 +1355,8 @@ jobs:
13241355
needs:
13251356
- build-all-features
13261357
- check
1327-
- build-freebsd
1358+
- build-freebsd-master
1359+
- build-freebsd-stable
13281360
- build-linux-pr
13291361
- build-linux-master
13301362
- build-linux-stable

ci/actions-templates/freebsd-builds-template.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
jobs: # skip-all
1+
jobs: # skip-master skip-stable
22

33
# This is ci/actions-templates/freebsd-builds-template.yaml
44
# Do not edit this file in .github/workflows
5-
build-freebsd: # job-name
5+
build-freebsd-master: # job-name skip-stable
6+
build-freebsd-stable: # job-name skip-master
67
runs-on: ubuntu-latest
8+
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-stable
9+
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-master
710
steps:
811
- uses: actions/checkout@v4
912
with:

ci/actions-templates/gen-workflows.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gen_job () {
77
grep -v "skip-$2" "$INPATH/$1-template.yaml" >> "$OUTPATH"
88
}
99

10-
cat << EOF > "$OUTPATH"
10+
cat << 'EOF' > "$OUTPATH"
1111
# GitHub Actions workflow generated by ci/actions-templates/gen-workflows.sh
1212
# Do not edit this file in .github/workflows
1313
@@ -39,8 +39,10 @@ gen_job linux-builds stable
3939
gen_job macos-builds x86_64
4040
gen_job macos-builds aarch64
4141

42+
gen_job freebsd-builds master
43+
gen_job freebsd-builds stable
44+
4245
# The following targets only have a single job
43-
gen_job freebsd-builds all
4446
gen_job centos-fmt-clippy all
4547
gen_job all-features all
4648
gen_job test-docs all

0 commit comments

Comments
 (0)