[antlir2][oss] cache buck-out #3517
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request, workflow_call] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: facebook/install-dotslash@latest | |
- uses: dtolnay/rust-toolchain@stable | |
id: rust-toolchain | |
- name: BTRFS-ify antlir2-out | |
run: | | |
mkdir antlir2-out | |
truncate -s 100G ${{ runner.temp }}/image.btrfs | |
mkfs.btrfs ${{ runner.temp }}/image.btrfs | |
sudo mount ${{ runner.temp }}/image.btrfs antlir2-out | |
- name: Install deps | |
run: | | |
sudo apt install \ | |
cpio jq systemd-container | |
- name: Restore buck2 cache | |
id: cache-buck2-restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
buck-out | |
key: buck2-${{steps.rust-toolchain.outputs.cachekey}}-${{ github.sha }} | |
restore-keys: | | |
buck2-${{steps.rust-toolchain.outputs.cachekey}} | |
- name: Disable watchman | |
run: | | |
echo '[buck2]' >> .buckconfig | |
echo 'file_watcher=notify' >> .buckconfig | |
- name: Find tests | |
run: | | |
./buck2 uquery 'kind(".*_test", set(%s)) - attrfilter(labels, disabled, set(%s))' \ | |
//antlir/antlir2/antlir2_facts/... \ | |
//antlir/antlir2/features/clone/tests: \ | |
//antlir/antlir2/features/install/tests: \ | |
//antlir/antlir2/features/rpm/tests: \ | |
//antlir/antlir2/features/tarball/tests: \ | |
| tee ${{ runner.temp }}/tests.txt | |
- name: Build tests | |
run: | | |
./buck2 build @${{ runner.temp }}/tests.txt | |
- name: Run tests | |
run: | | |
./buck2 test @${{ runner.temp }}/tests.txt | |
- name: Save buck2 cache | |
id: cache-buck2-save | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
buck-out | |
key: buck2-${{steps.rust-toolchain.outputs.cachekey}}-${{ github.sha }} |