Skip to content

Commit

Permalink
ci: don't test for FreeBSD on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Apr 15, 2024
1 parent 8f9fe8f commit f26d16b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,39 @@ jobs:

# This is ci/actions-templates/freebsd-builds-template.yaml
# Do not edit this file in .github/workflows
build-freebsd: # job-name
build-freebsd-master: # job-name skip-stable
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-stable
steps:
- uses: actions/checkout@v4
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
- name: Acquire tags for the repo
run: |
git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
- name: Run a full build
uses: vmactions/freebsd-vm@v1
with:
release: 13.2
usesh: true
copyback: false
prepare: |
pkg install -y git gmake bash sudo
run: |
echo "========="
echo "create non-root user and log into it"
pw group add -n tester
pw user add -n tester -g tester -s `which bash`
pw user mod tester -d `pwd`
chown -R tester .
sudo -u tester bash ci/freebsd/script.bash
# This is ci/actions-templates/freebsd-builds-template.yaml
# Do not edit this file in .github/workflows
build-freebsd-stable: # job-name skip-master
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-master
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -1324,7 +1355,8 @@ jobs:
needs:
- build-all-features
- check
- build-freebsd
- build-freebsd-master
- build-freebsd-stable
- build-linux-pr
- build-linux-master
- build-linux-stable
Expand Down
7 changes: 5 additions & 2 deletions ci/actions-templates/freebsd-builds-template.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
jobs: # skip-all
jobs: # skip-master skip-stable

# This is ci/actions-templates/freebsd-builds-template.yaml
# Do not edit this file in .github/workflows
build-freebsd: # job-name
build-freebsd-master: # job-name skip-stable
build-freebsd-stable: # job-name skip-master
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-stable
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-master
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 4 additions & 2 deletions ci/actions-templates/gen-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gen_job () {
grep -v "skip-$2" "$INPATH/$1-template.yaml" >> "$OUTPATH"
}

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

gen_job freebsd-builds master
gen_job freebsd-builds stable

# The following targets only have a single job
gen_job freebsd-builds all
gen_job centos-fmt-clippy all
gen_job all-features all
gen_job test-docs all
Expand Down

0 comments on commit f26d16b

Please sign in to comment.