Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Added scheduled builds and updated to install Swift and use simpler S…
Browse files Browse the repository at this point in the history
…wift Bazel config for Linux. (#114)
  • Loading branch information
cgrindel committed Jan 31, 2022
1 parent 6e0ced8 commit 8a81347
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: CI for PR Merge
on:
pull_request:
branches: [ main ]
schedule:
# Every day at 11:14 UTC.
- cron: '14 11 * * *'

jobs:

Expand All @@ -24,21 +27,29 @@ jobs:
env:
CC: clang
steps:
- uses: cgrindel/gha_install_swift_on_ubuntu@v1
with:
swift_release_tag: "swift-5.5.2-RELEASE"
ubuntu_version: "20.04"
- uses: actions/checkout@v2
- name: Bazel Config for Linux
- name: Update local.bazelrc with Linux Flags
shell: bash
run: |
# Make sure that the Swift bin directory is first in the PATH. This addresses
# the `invalid linker name in argument '-fuse-ld=gold'` error when running
# SPM. In short, it allows SPM to find the correct linker.
swift_exec=$(which swift)
real_swift_exec=$(realpath $swift_exec)
real_swift_dir=$(dirname $real_swift_exec)
new_path="${real_swift_dir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
cat >>local.bazelrc <<EOF
build --action_env=PATH=${new_path}
cat >> "local.bazelrc" <<EOF
# Need to expose the PATH so that the Swift toolchain can be found
build --action_env=PATH
EOF
- uses: cgrindel/gha_set_up_bazel@v1
with:
repo_name: rules_spm
- uses: ./.github/actions/build_and_test

all_ci_tests:
runs-on: ubuntu-20.04
needs: [macos_build, ubuntu_build]
steps:
- name: All is Well
shell: bash
run: |
echo "All is well!"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swift Package Manager Rules for Bazel

[![Build](https://github.com/cgrindel/rules_spm/actions/workflows/ci.yml/badge.svg)](https://github.com/cgrindel/rules_spm/actions/workflows/ci.yml)
[![Build](https://github.com/cgrindel/rules_spm/actions/workflows/ci.yml/badge.svg?event=schedule)](https://github.com/cgrindel/rules_spm/actions/workflows/ci.yml)

This repository contains rules for [Bazel](https://bazel.build/) that can be used to download, build
and consume Swift packages with [rules_swift](https://github.com/bazelbuild/rules_swift) rules. The
Expand Down

0 comments on commit 8a81347

Please sign in to comment.