diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 839efbad85..72752394fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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: @@ -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 diff --git a/ci/actions-templates/freebsd-builds-template.yaml b/ci/actions-templates/freebsd-builds-template.yaml index 22e2aeab2a..2c85b57921 100644 --- a/ci/actions-templates/freebsd-builds-template.yaml +++ b/ci/actions-templates/freebsd-builds-template.yaml @@ -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: diff --git a/ci/actions-templates/gen-workflows.sh b/ci/actions-templates/gen-workflows.sh index c09a3594b1..d2ea6f7fcd 100755 --- a/ci/actions-templates/gen-workflows.sh +++ b/ci/actions-templates/gen-workflows.sh @@ -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 @@ -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