Skip to content

Commit ff84b03

Browse files
miguelrazlistochkin
authored andcommitted
make build run weekly on mondays, skip if in PR
1 parent e360000 commit ff84b03

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/build.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build sample material
22

33
on:
4+
schedule:
5+
- cron: '0 0 * * Mon' # Run this job weekly, on Monday midnights
46
push:
57
pull_request:
68

@@ -52,3 +54,75 @@ jobs:
5254
artifacts: "./rust-exercises-${{ env.slug }}.zip,./rust-exercises-${{ env.slug }}/nrf52-code/boards/dongle-fw/*-fw"
5355
allowUpdates: true
5456
updateOnlyUnreleased: true
57+
58+
build-weekly-beta:
59+
runs-on: ubuntu-20.04
60+
if: needs.pr-check.outputs.number != null
61+
concurrency:
62+
group: ${{ github.workflow }}-${{ github.ref }}
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Install tools
67+
uses: taiki-e/install-action@v2
68+
with:
69+
70+
71+
- name: Install targets
72+
run: |
73+
rustup target add thumbv7em-none-eabihf
74+
rustup component add rust-src
75+
rustup component add rustfmt
76+
77+
- name: Update Beta
78+
run: |
79+
rustup update beta
80+
rustup default beta
81+
82+
- name: Find slug name
83+
run: |
84+
slug=$(./describe.sh "${GITHUB_REF}")
85+
echo "Building with slug '${slug}'"
86+
echo "slug=${slug}" >> "${GITHUB_ENV}"
87+
88+
- name: Build and test
89+
env: # Or as an environment variable
90+
HIDDEN_MESSAGE: ${{ secrets.HIDDEN_MESSAGE }}
91+
run: |
92+
./build.sh "./rust-exercises-${{ env.slug }}"
93+
94+
build-weekly-nightly:
95+
runs-on: ubuntu-20.04
96+
if: needs.pr-check.outputs.number != null
97+
concurrency:
98+
group: ${{ github.workflow }}-${{ github.ref }}
99+
steps:
100+
- uses: actions/checkout@v4
101+
102+
- name: Install tools
103+
uses: taiki-e/install-action@v2
104+
with:
105+
106+
107+
- name: Install targets
108+
run: |
109+
rustup target add thumbv7em-none-eabihf
110+
rustup component add rust-src
111+
rustup component add rustfmt
112+
113+
- name: Update Nightly
114+
run: |
115+
rustup update nightly
116+
rustup default nightly
117+
118+
- name: Find slug name
119+
run: |
120+
slug=$(./describe.sh "${GITHUB_REF}")
121+
echo "Building with slug '${slug}'"
122+
echo "slug=${slug}" >> "${GITHUB_ENV}"
123+
124+
- name: Build and test
125+
env: # Or as an environment variable
126+
HIDDEN_MESSAGE: ${{ secrets.HIDDEN_MESSAGE }}
127+
run: |
128+
./build.sh "./rust-exercises-${{ env.slug }}"

0 commit comments

Comments
 (0)