-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: test using containers, unify build script (#97)
* ci: test using containers, unify build script * ci: bump github actions action versions
- Loading branch information
Showing
7 changed files
with
71 additions
and
144 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build, test and push backend container | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
component: [backend, frontend] | ||
|
||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Quay.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: rosalindfranklininstitute+github_antigenapp | ||
password: ${{ secrets.QUAYIO_TOKEN }} | ||
|
||
- name: Build dev image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ${{ matrix.component }} | ||
target: dev | ||
platforms: linux/amd64 | ||
load: true | ||
tags: antigen-app-dev-${{ matrix.component }}:latest | ||
|
||
- name: Run backend tests | ||
if: ${{ matrix.component == 'backend' }} | ||
run: | | ||
docker run --rm -e DJANGO_CI=true antigen-app-dev-backend:latest pipenv run tests | ||
- name: Run frontend tests | ||
if: ${{ matrix.component == 'frontend' }} | ||
run: | | ||
docker run --rm -e CI=true antigen-app-dev-frontend:latest npm test | ||
docker run --rm antigen-app-dev-frontend:latest npx prettier --check . | ||
- name: Build and push prod image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ${{ matrix.component }} | ||
target: prod | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: quay.io/rosalindfranklininstitute/antigen-app-${{ matrix.component }}:latest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
import App from "./App"; | ||
import { createRoot } from "react-dom/client"; | ||
|
||
test("renders learn react link", () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/Named Nanobodies/); | ||
expect(linkElement).toBeInTheDocument(); | ||
it("renders without crashing", () => { | ||
const container = document.createElement("div"); | ||
const root = createRoot(container); | ||
root.render(<App />); | ||
}); |