convert circleci lint job to github actions

Start the migration from CircleCI to GitHub Actions with migrating the lint
job. Used the structure from @robandpdx to setup Nix and use a GitHub key.
Restructured the check from `nix flake check` to
`nix fmt; git diff --exit-code` so we get a full patch again.

Test plan:
- Submitted this PR with a formatting error. CI failed. Submitted without and
  it passed.

Co-Authored By: Rob Anderson <robandpdx@github.com>
This commit is contained in:
Jake Hillion 2024-02-20 14:54:14 +00:00
parent 7103680894
commit 3bfaa01cf9
3 changed files with 16 additions and 15 deletions

View File

@ -3,8 +3,6 @@ version: 2.1
workflows: workflows:
object-introspection: object-introspection:
jobs: jobs:
- lint
- build: - build:
name: build-gcc name: build-gcc
cc: /usr/bin/gcc cc: /usr/bin/gcc
@ -33,10 +31,6 @@ workflows:
exclude_regex: ".*inheritance_polymorphic.*|.*arrays_member_int0|.*fbstring.*|.*std_string_*|.*multi_arg_tb_.*|.*ignored_member|OilIntegration.fbstring_.*|OilIntegration.capture_keys_string|OilIntegration.capture_keys_multi_level" exclude_regex: ".*inheritance_polymorphic.*|.*arrays_member_int0|.*fbstring.*|.*std_string_*|.*multi_arg_tb_.*|.*ignored_member|OilIntegration.fbstring_.*|OilIntegration.capture_keys_string|OilIntegration.capture_keys_multi_level"
executors: executors:
nix-docker:
docker:
- image: nixos/nix:latest
resource_class: small
ubuntu-docker: ubuntu-docker:
docker: docker:
- image: ubuntu:jammy - image: ubuntu:jammy
@ -47,14 +41,6 @@ executors:
resource_class: 2xlarge resource_class: 2xlarge
jobs: jobs:
lint:
executor: nix-docker
steps:
- checkout
- run:
name: Flake check
command: nix --experimental-features 'nix-command flakes' flake check
build: build:
# TODO this job could be run in Docker # TODO this job could be run in Docker
executor: big-boy executor: big-boy

View File

@ -0,0 +1,15 @@
name: facebookexperimental/object-introspection
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.0
- uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Flake check
run: |-
nix --experimental-features 'nix-command flakes' fmt
git diff --exit-code

View File

@ -30,7 +30,7 @@
#include <chrono> #include <chrono>
#include <cstddef> #include <cstddef>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <numeric> #include <numeric>
#include <span> #include <span>