From 03cfc153eafcec2d54ec1000ee2dc1efb2d7f737 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 12 Aug 2024 14:52:08 -0400 Subject: [PATCH] [tmp] actions --- .drone.yml | 296 ------------------------------------ .github/workflows/main.yaml | 80 ++++++++++ 2 files changed, 80 insertions(+), 296 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/main.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 217c4d13..00000000 --- a/.drone.yml +++ /dev/null @@ -1,296 +0,0 @@ ---- -kind: pipeline -type: docker -name: tests - -global-variables: - environment: &default_environment - GOPATH: "/go" - GOCACHE: "/go/.cache/go-build" - GOENV: "/go/.config/go/env" - GOMODCACHE: "/go/pkg/mod" -steps: - - name: pull - image: omerxx/drone-ecr-auth - commands: - - $(aws ecr get-login --no-include-email --region us-east-1) - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.0.5 - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:2022-02-11 - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - volumes: - - name: docker.sock - path: /var/run/docker.sock - - name: build - image: golang:1.22 - environment: - <<: *default_environment - commands: - - make install - - go get ./... - volumes: - - name: go - path: /go - - name: configlib, no system renv - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - cd configlib - - go test -v . - - name: configlib, system renv (< 0.15) - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:2022-02-11 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PKGR_TESTS_SYS_RENV=1 - - cd configlib - - go test -v . - - name: configlib, system renv (>= 0.15) - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PKGR_TESTS_SYS_RENV=1 - - cd configlib - - go test -v . - - name: gpsr - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - cd gpsr - - go test -v . - - name: cran - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - cd cran - - go test -v . - - name: baseline - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/baseline - - make test - - name: version - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/version - - make test - - name: rollback - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/rollback - - make test - - name: outdated - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/outdated-pkgs - - make test - - name: load - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/load - - make test - - name: multi-repo - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/multi-repo - - make test - - name: bad-customization - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/bad-customization - - make test - - name: recommended-packages - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/recommended - - make test - - name: rpath-env-var - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/env-vars - - make test - - name: tarball-install - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/tarball-install - - make test - - name: libraries - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.1.0 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/library - - make test - - name: libraries, system renv (< 0.15) - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:2022-02-11 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - export PKGR_TESTS_SYS_RENV=1 - - cd integration_tests/library - - make test - - name: libraries, system renv (>= 0.15) - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - export PKGR_TESTS_SYS_RENV=1 - - cd integration_tests/library - - make test - - name: mixed-source-and-customizations - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci:4.0.5 - pull: never - volumes: - - name: go - path: /go - environment: - <<: *default_environment - commands: - - export PATH=/go/bin:$PATH - - cd integration_tests/mixed-source - - make test -volumes: - - name: docker.sock - host: - path: /var/run/docker.sock - - name: go - temp: { } - ---- -kind: pipeline -type: docker -name: goreleaser - -platform: - os: linux - arch: amd64 - -steps: - - name: goreleaser - image: goreleaser/goreleaser - commands: - - git config --global user.email "drone@metrumrg.com" - - git config --global user.name "Drony" - - git fetch --tags - - cd cmd/pkgr - - goreleaser --rm-dist - environment: - GITHUB_TOKEN: - from_secret: GITHUB_TOKEN - VERSION: ${DRONE_TAG} - -trigger: - event: - - tag - -depends_on: - - tests diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..e23b198f --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,80 @@ +name: CI +on: + push: + branches: + - main + - 'scratch/**' + tags: + - 'v*' + pull_request: + +jobs: + check: + runs-on: ubuntu-20.04 + name: Tests (renv = ${{ matrix.config.renv }}) + strategy: + fail-fast: false + matrix: + config: + - renv: true + - renv: false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 4.3.1 + use-public-rspm: true + - name: Install other system dependencies + shell: bash + run: | + sudo DEBIAN_FRONTEND=noninteractive \ + apt-get install -y libcurl4-openssl-dev + - name: Install renv + if: matrix.config.renv + uses: r-lib/actions/setup-r-dependencies@v2 + with: + packages: 'any::renv' + - name: Debug R + shell: bash + run: | + which Rscript + Rscript -e 'find.package("renv")' || : + - name: Build + shell: bash + run: go build ./... + - name: Unit + shell: bash + run: ./scripts/run-unit-tests + env: + PKGR_TESTS_SYS_RENV: ${{ matrix.config.renv && '1' || '' }} + - name: Integration + shell: bash + run: ./scripts/run-integration-tests + env: + PKGR_TESTS_SYS_RENV: ${{ matrix.config.renv && '1' || '' }} + release: + if: github.ref_type == 'tag' + name: Make release + needs: check + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: '~> v2' + args: release --clean + workdir: cmd/bbi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}